node_test_exception.module

Same filename in other branches
  1. 9 core/modules/node/tests/modules/node_test_exception/node_test_exception.module
  2. 8.9.x core/modules/node/tests/modules/node_test_exception/node_test_exception.module
  3. 10 core/modules/node/tests/modules/node_test_exception/node_test_exception.module
  4. 11.x core/modules/node/tests/modules/node_test_exception/node_test_exception.module

A module implementing node related hooks to test API interaction.

File

modules/node/tests/node_test_exception.module

View source
<?php


/**
 * @file
 * A module implementing node related hooks to test API interaction.
 */

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

Functions

Title Deprecated Summary
node_test_exception_node_insert Implements hook_node_insert().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.