summaryrefslogtreecommitdiff
path: root/modules/comment/comment.test
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-22 08:12:30 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-04-22 08:12:30 +0000
commita6735f57ff88d8034deaa8191776facf4ebd64dc (patch)
treeec5025af797119a68dec88bc1453cd832c7414c2 /modules/comment/comment.test
parent53f6d10baaaa43a4bb66d4c2123990130a4fb9cd (diff)
downloadbrdo-a6735f57ff88d8034deaa8191776facf4ebd64dc.tar.gz
brdo-a6735f57ff88d8034deaa8191776facf4ebd64dc.tar.bz2
#691692 by Stefan Freudenberg, linclark: Improve RDF tests.
Diffstat (limited to 'modules/comment/comment.test')
-rw-r--r--modules/comment/comment.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/comment/comment.test b/modules/comment/comment.test
index b04618724..66933615e 100644
--- a/modules/comment/comment.test
+++ b/modules/comment/comment.test
@@ -1199,6 +1199,30 @@ class CommentRdfaTestCase extends CommentHelperCase {
}
/**
+ * Test RDF comment replies.
+ */
+ function testCommentReplyOfRdfaMarkup() {
+ // Posts comment #1 as a registered user.
+ $this->drupalLogin($this->web_user);
+ $comments[] = $this->postComment($this->node1, $this->randomName(), $this->randomName());
+
+ // Tests the reply_of relationship of a first level comment.
+ $result = $this->xpath("id('comments')//div[@class='comment' and position()=0]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}")));
+ $this->assertEqual(1, count($result), t('RDFa markup referring to the node is present.'));
+ $result = $this->xpath("id('comments')//div[@class='comment' and position()=0]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1#comment-1')));
+ $this->assertFalse($result, t('No RDFa markup referring to the comment itself is present.'));
+
+ // Posts a reply to the first comment.
+ $this->drupalGet('comment/reply/' . $this->node1->nid . '/' . $comments[0]->id);
+ $comments[] = $this->postComment(NULL, $this->randomName(), $this->randomName(), TRUE);
+
+ // Tests the reply_of relationship of a second level comment.
+ $result = $this->xpath("id('comments')//div[@class='comment' and position()=1]//span[@rel='sioc:reply_of' and @resource=:node]", array(':node' => url("node/{$this->node1->nid}")));
+ $this->assertEqual(1, count($result), t('RDFa markup referring to the node is present.'));
+ $result = $this->xpath("id('comments')//div[@class='comment' and position()=1]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1#comment-1')));
+ $this->assertEqual(1, count($result), t('RDFa markup referring to the parent comment is present.'));
+ }
+ /**
* Helper function for testCommentRdfaMarkup().
*
* Tests the current page for basic comment RDFa markup.