NodeBuildContent::testNodeRebuildContent

7 node.test NodeBuildContent::testNodeRebuildContent()
8 node.test NodeBuildContent::testNodeRebuildContent()

Test to ensure that a node's content array is rebuilt on every call to node_build_content().

File

modules/node/node.test, line 1966
Tests for node.module.

Code

function testNodeRebuildContent() {
  $node = $this->drupalCreateNode();

  // Set a property in the content array so we can test for its existence later on.
  $node->content['test_content_property'] = array('#value' => $this->randomString());
  $content = node_build_content($node);

  // If the property doesn't exist it means the node->content was rebuilt.
  $this->assertFalse(isset($content['test_content_property']), t('Node content was emptied prior to being built.'));
}
Login or register to post comments