1.20.x node.test NodeSaveTestCase::testNodeSaveOnInsert()

Tests saving a node on node insert.

This test ensures that a node has been fully saved when hook_node_insert() is invoked, so that the node can be saved again in a hook implementation without errors.

See also

node_test_node_insert()

File

modules/node/tests/node.test, line 1744
Tests for node.module.

Class

NodeSaveTestCase
Tests node save related functionality, including import-save.

Code

function testNodeSaveOnInsert() {
  // node_test_node_insert() tiggers a save on insert if the title equals
  // 'new'.
  $node = $this->backdropCreateNode(array('title' => 'new'));
  $this->assertEqual($node->title, 'Node ' . $node->nid, 'Node saved on node insert.');
}