node_test_exception.module

You are here

  1. 7 modules/node/tests/node_test_exception.module
  2. 8 core/modules/node/tests/modules/node_test_exception/node_test_exception.module

A module implementing node related hooks to test API interaction.

Functions

File

modules/node/tests/node_test_exception.module
View source
  1. <?php
  2. /**
  3. * @file
  4. * A module implementing node related hooks to test API interaction.
  5. */
  6. /**
  7. * Implements hook_node_insert().
  8. */
  9. function node_test_exception_node_insert($node) {
  10. if ($node->title == 'testing_transaction_exception') {
  11. throw new Exception('Test exception for rollback.');
  12. }
  13. }