diff options
author | David Rothstein <drothstein@gmail.com> | 2012-06-04 01:18:27 -0400 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2012-06-04 01:18:27 -0400 |
commit | ecf40c67a9e24fea52ec4d83bc723a27143866e6 (patch) | |
tree | 6bd3b4c1d750d4aeabd79df77a5d98912dac89ad /modules/comment/comment.test | |
parent | bbe4b34681f9bb52c344ac4475c1adc7b5c3f601 (diff) | |
download | brdo-ecf40c67a9e24fea52ec4d83bc723a27143866e6.tar.gz brdo-ecf40c67a9e24fea52ec4d83bc723a27143866e6.tar.bz2 |
Issue #890790 by Tor Arne Thune, davidjdagino, moshe weitzman | jenlampton: Added tests to ensure that deleting nodes deletes their comments.
Diffstat (limited to 'modules/comment/comment.test')
-rw-r--r-- | modules/comment/comment.test | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/comment/comment.test b/modules/comment/comment.test index 4c6755522..e787d25d1 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -2196,3 +2196,28 @@ class CommentThreadingTestCase extends CommentHelperCase { $this->assertEqual($reply_loaded->thread, '02.01/'); } } + +/** + * Tests that comments behave correctly when the node is changed. + */ +class CommentNodeChangesTestCase extends CommentHelperCase { + + public static function getInfo() { + return array( + 'name' => 'Comment deletion on node changes', + 'description' => 'Tests that comments behave correctly when the node is changed.', + 'group' => 'Comment', + ); + } + + /** + * Tests that comments are deleted with the node. + */ + function testNodeDeletion() { + $this->drupalLogin($this->web_user); + $comment = $this->postComment($this->node, $this->randomName(), $this->randomName()); + $this->assertTrue(comment_load($comment->id), 'The comment could be loaded.'); + node_delete($this->node->nid); + $this->assertFalse(comment_load($comment->id), 'The comment could not be loaded after the node was deleted.'); + } +} |