? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.52
diff -u -p -r1.52 comment.test
--- modules/comment/comment.test	20 Oct 2009 17:33:42 -0000	1.52
+++ modules/comment/comment.test	3 Nov 2009 07:22:41 -0000
@@ -914,3 +914,35 @@ class CommentRdfaTestCase extends Commen
     $this->assertEqual((string)$comment_author[0], $this->web_user->name);
   }
 }
+
+/**
+ * Test to make sure comment content is rebuilt.
+ */
+class CommentContentRebuild extends CommentHelperCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Comment Rebuild',
+      'description' => 'Test to make sure the comment content is rebuilt',
+      'group' => 'Comment',
+    );
+  }
+
+  public function testCommentRebuild() {
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentSubject(TRUE);
+    $this->setCommentPreview(DRUPAL_OPTIONAL);
+    $this->drupalLogout();
+    $this->drupalLogin($this->web_user);
+    $subject_text = $this->randomName();
+    $comment_text = $this->randomName();
+    $comment = $this->postComment($this->node, $comment_text, $subject_text, TRUE);
+    $comment_loaded = comment_load($comment->id);
+    $this->assertTrue($this->commentExists($comment), t('Comment found.'));
+    
+    // add the property to the content array and then see if it still exists on build
+    $comment_loaded->content['test_property'] = array('#value' => $this->randomString());
+    $built_content = comment_build($comment_loaded, $this->node);
+    // this means that the content was rebuilt as the added test property no longer exists
+    $this->assertFalse(isset($built_content['test_property']), t('Comment content is rebuilt'));
+  }
+}
\ No newline at end of file
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.52
diff -u -p -r1.52 node.test
--- modules/node/node.test	3 Nov 2009 04:35:01 -0000	1.52
+++ modules/node/node.test	3 Nov 2009 07:22:42 -0000
@@ -1070,3 +1070,26 @@ class NodeFeedTestCase extends DrupalWeb
     $this->assertTrue(strpos($output, '<copyright>Drupal is a registered trademark of Dries Buytaert.</copyright>') !== FALSE);
   }
 }
+
+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',
+    );
+  }
+
+ /**
+  * Create one node and add a piece to its content array. ensure that that piece doesn't remain
+  */
+  function testNodeRebuildContent() {
+    $node = $this->drupalCreateNode();
+    // set a property in the content array so we can test for its exsistance 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 rebuilt'));
+  }
+}
\ No newline at end of file
