diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-01-24 15:21:06 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-01-24 15:21:06 +0000 |
commit | 3fbe8b721b6ecb9e5700f6d6e9146781c1795064 (patch) | |
tree | 4a8f82bc449c9dc12e70e6fdb9f553bc9a2ef9e9 /modules/node/node.test | |
parent | 8641f9dcfd779556a5eb125921053387b0fe5580 (diff) | |
download | brdo-3fbe8b721b6ecb9e5700f6d6e9146781c1795064.tar.gz brdo-3fbe8b721b6ecb9e5700f6d6e9146781c1795064.tar.bz2 |
- Patch #564642 by Scott Reynolds: added tests for node_rebuild() and comment_rebuild().
Diffstat (limited to 'modules/node/node.test')
-rw-r--r-- | modules/node/node.test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/node/node.test b/modules/node/node.test index 394f7e391..834a058e5 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -1357,3 +1357,31 @@ class MultiStepNodeFormBasicOptionsTest extends DrupalWebTestCase { $this->assertFieldChecked('edit-sticky', 'sticky stayed checked'); } } + +/** + * Test to ensure that a node's content is always rebuilt. + */ +class NodeBuildContent extends DrupalWebTestCase { + + public static function getInfo() { + return array( + 'name' => 'Rebuild content', + 'description' => 'Test the rebuilding of content for different build modes.', + 'group' => 'Node', + ); + } + + /** + * Test to ensure that a node's content array is rebuilt on every call to node_build_content(). + */ + function testNodeRebuildContent() { + $node = $this->drupalCreateNode(); + + // Set a property in the content array so we can test for its existance 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.')); + } +}
\ No newline at end of file |