summaryrefslogtreecommitdiff
path: root/modules/rdf
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-21 10:17:33 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-11-21 10:17:33 +0000
commit6539970db4123c1202538aa6149bf9a9e94efe66 (patch)
tree1bbe44e0f76e99c37fbd3d68715dc96db94ce1b8 /modules/rdf
parentfc8be9eeb4a8fbe872da57b8e270966a1ba45eae (diff)
downloadbrdo-6539970db4123c1202538aa6149bf9a9e94efe66.tar.gz
brdo-6539970db4123c1202538aa6149bf9a9e94efe66.tar.bz2
#933856 by Damien Tournoud: Fixed xpath() return values are inconsistent, leading to failing tests on some environments.
Diffstat (limited to 'modules/rdf')
-rw-r--r--modules/rdf/rdf.test9
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/rdf/rdf.test b/modules/rdf/rdf.test
index 4cab590ac..5ba2e37a6 100644
--- a/modules/rdf/rdf.test
+++ b/modules/rdf/rdf.test
@@ -511,9 +511,9 @@ class RdfCommentAttributesTestCase extends CommentHelperCase {
$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}")));
+ $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[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()=0]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1#comment-1')));
+ $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=1]//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.
@@ -521,10 +521,11 @@ class RdfCommentAttributesTestCase extends CommentHelperCase {
$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}")));
+ $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]//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')));
+ $result = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]//span[@rel='sioc:reply_of' and @resource=:comment]", array(':comment' => url('comment/1', array('fragment' => 'comment-1'))));
$this->assertEqual(1, count($result), t('RDFa markup referring to the parent comment is present.'));
+ $comments = $this->xpath("(id('comments')//div[contains(@class,'comment ')])[position()=2]");
}
/**