summaryrefslogtreecommitdiff
path: root/modules/comment/comment.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-10-14 20:34:56 +0000
committerDries Buytaert <dries@buytaert.net>2008-10-14 20:34:56 +0000
commit126a5e3c881f64c8fa37333626e08e619a209786 (patch)
tree3c17e0b4b36a87019a8b1c9b08fe3a8542a82449 /modules/comment/comment.test
parentc9cbd0d55d15839091d4c1d7c37b95d1713bc0bc (diff)
downloadbrdo-126a5e3c881f64c8fa37333626e08e619a209786.tar.gz
brdo-126a5e3c881f64c8fa37333626e08e619a209786.tar.bz2
- Patch #320784 by johnskulski: added test for comment threading. This test currently fails.
Diffstat (limited to 'modules/comment/comment.test')
-rw-r--r--modules/comment/comment.test15
1 files changed, 14 insertions, 1 deletions
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index 5372940f0..c342a4baa 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -269,6 +269,7 @@ class CommentInterfaceTest extends CommentHelperCase {
$subject_text = $this->randomName();
$comment_text = $this->randomName();
$comment = $this->postComment($this->node, $subject_text, $comment_text);
+ $comment_loaded = comment_load($comment->id);
$this->assertTrue($this->commentExists($comment), t('Comment found.'));
// Check comment display.
@@ -281,7 +282,19 @@ class CommentInterfaceTest extends CommentHelperCase {
$this->assertText($subject_text, t('Individual comment-reply subject found.'));
$this->assertText($comment_text, t('Individual comment-reply body found.'));
$reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
+ $reply_loaded = comment_load($reply->id);
$this->assertTrue($this->commentExists($reply, TRUE), t('Reply found.'));
+ $this->assertEqual($comment->id, $reply_loaded->pid, t('Pid of a reply to a comment is set correctly.'));
+ $this->assertEqual(rtrim($comment_loaded->thread,'/').'.00/', $reply_loaded->thread, t('Thread of reply grows correctly.'));
+
+ // Second reply to comment
+ $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+ $this->assertText($subject_text, t('Individual comment-reply subject found.'));
+ $this->assertText($comment_text, t('Individual comment-reply body found.'));
+ $reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
+ $reply_loaded = comment_load($reply->id);
+ $this->assertTrue($this->commentExists($reply, TRUE), t('Second reply found.'));
+ $this->assertEqual(rtrim($comment_loaded->thread,'/').'.01/', $reply_loaded->thread, t('Thread of second reply grows correctly.'));
// Edit reply.
$this->drupalGet('comment/edit/' . $reply->id);
@@ -290,7 +303,7 @@ class CommentInterfaceTest extends CommentHelperCase {
// Correct link count
$this->drupalGet('node');
- $this->assertRaw('2 comments', t('Link to the 2 comments exist.'));
+ $this->assertRaw('3 comments', t('Link to the 3 comments exist.'));
// Pager
$this->setCommentsPerPage(2);