Tests RDF comment replies.
public function testCommentReplyOfRdfaMarkup() {
// Posts comment #1 on behalf of registered user.
$this
->drupalLogin($this->web_user);
$comment_1 = $this
->saveComment($this->node->nid, $this->web_user->uid);
$comment_1_uri = url('comment/' . $comment_1
->id(), array(
'absolute' => TRUE,
));
// Posts a reply to the first comment.
$comment_2 = $this
->saveComment($this->node->nid, $this->web_user->uid, NULL, $comment_1
->id());
$comment_2_uri = url('comment/' . $comment_2
->id(), array(
'absolute' => TRUE,
));
$parser = new \EasyRdf_Parser_Rdfa();
$graph = new \EasyRdf_Graph();
$parser
->parse($graph, $this
->drupalGet('node/' . $this->node->nid), 'rdfa', $this->base_uri);
// Tests the reply_of relationship of a first level comment.
$expected_value = array(
'type' => 'uri',
'value' => $this->node_uri,
);
$this
->assertTrue($graph
->hasProperty($comment_1_uri, 'http://rdfs.org/sioc/ns#reply_of', $expected_value), 'Comment relation to its node found in RDF output (sioc:reply_of).');
// Tests the reply_of relationship of a second level comment.
$expected_value = array(
'type' => 'uri',
'value' => $this->node_uri,
);
$this
->assertTrue($graph
->hasProperty($comment_2_uri, 'http://rdfs.org/sioc/ns#reply_of', $expected_value), 'Comment relation to its node found in RDF output (sioc:reply_of).');
$expected_value = array(
'type' => 'uri',
'value' => $comment_1_uri,
);
$this
->assertTrue($graph
->hasProperty($comment_2_uri, 'http://rdfs.org/sioc/ns#reply_of', $expected_value), 'Comment relation to its parent comment found in RDF output (sioc:reply_of).');
}