You are here

function node_test_exception_node_insert in Drupal 7

Same name and namespace in other branches
  1. 8 core/modules/node/tests/modules/node_test_exception/node_test_exception.module \node_test_exception_node_insert()
  2. 9 core/modules/node/tests/modules/node_test_exception/node_test_exception.module \node_test_exception_node_insert()

Implements hook_node_insert().

File

modules/node/tests/node_test_exception.module, line 11
A module implementing node related hooks to test API interaction.

Code

function node_test_exception_node_insert($node) {
  if ($node->title == 'testing_transaction_exception') {
    throw new Exception('Test exception for rollback.');
  }
}