summaryrefslogtreecommitdiff
path: root/modules/node/node.test
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-12-30 18:46:34 -0500
committerDavid Rothstein <drothstein@gmail.com>2013-12-30 18:46:34 -0500
commita4a72dc277fc89eb36964c1509ad1b30121a013a (patch)
treeb433075f02648add69b02d7c89b356ff8c61d557 /modules/node/node.test
parentcb7127c514aee7e66659da3f20348db4c013a40c (diff)
downloadbrdo-a4a72dc277fc89eb36964c1509ad1b30121a013a.tar.gz
brdo-a4a72dc277fc89eb36964c1509ad1b30121a013a.tar.bz2
Issue #1146244 by Dean Reilly, klausi, fago, firebird, David_Rothstein, aaronbauman, shenzhuxi, jaanhoinatski, themoep, citlacom: Node_access integrity constraint violation on module_invoke_all('node_' . $op, $node);.
Diffstat (limited to 'modules/node/node.test')
-rw-r--r--modules/node/node.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/node/node.test b/modules/node/node.test
index 3cafefa1d..bfe371755 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -1363,6 +1363,22 @@ class NodeSaveTestCase extends DrupalWebTestCase {
$node = node_load($node->nid);
$this->assertEqual($node->title, 'updated_presave', 'Static cache has been cleared.');
}
+
+ /**
+ * 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 node_test_node_insert()
+ */
+ function testNodeSaveOnInsert() {
+ // node_test_node_insert() tiggers a save on insert if the title equals
+ // 'new'.
+ $node = $this->drupalCreateNode(array('title' => 'new'));
+ $this->assertEqual($node->title, 'Node ' . $node->nid, 'Node saved on node insert.');
+ }
}
/**