1 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
File
- core/
modules/ node/ tests/ node.test, line 1975 - Tests for node.module.
Class
- NodeSaveTestCase
- Tests node save related functionality, including import-save.
Code
function testNodeSaveOnInsert() {
// node_test_node_insert() triggers 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.');
}