protected function StandardProfileTest::doArticleRdfaTests in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/rdf/src/Tests/StandardProfileTest.php \Drupal\rdf\Tests\StandardProfileTest::doArticleRdfaTests()
Tests that article data is exposed using RDFa.
Two fields are not tested for output here. Changed date is not displayed on the page, so there is no test for output in node view. Comment count is displayed in teaser view, so it is tested in the front article tests.
1 call to StandardProfileTest::doArticleRdfaTests()
- StandardProfileTest::testRdfaOutput in core/
modules/ rdf/ src/ Tests/ StandardProfileTest.php - Tests that data is exposed correctly when using standard profile.
File
- core/
modules/ rdf/ src/ Tests/ StandardProfileTest.php, line 247 - Contains \Drupal\rdf\Tests\StandardProfileTest.
Class
- StandardProfileTest
- Tests the RDF mappings and RDFa markup of the standard profile.
Namespace
Drupal\rdf\TestsCode
protected function doArticleRdfaTests() {
// Feed the HTML into the parser.
$graph = $this
->getRdfGraph($this->article
->urlInfo());
// Type.
$this
->assertEqual($graph
->type($this->articleUri), 'schema:Article', 'Article type was found (schema:Article).');
// Test the properties that are common between pages and articles.
$this
->assertRdfaCommonNodeProperties($graph, $this->article, "Article");
// Test properties that are displayed in both teaser and full mode.
$this
->assertRdfaArticleProperties($graph, "Article");
// Test the comment properties displayed on articles.
$this
->assertRdfaNodeCommentProperties($graph);
// @todo Once the image points to the original instead of the processed
// image, move this to testArticleProperties().
$expected_value = array(
'type' => 'uri',
'value' => $this->imageUri,
);
$this
->assertTrue($graph
->hasProperty($this->articleUri, 'http://schema.org/image', $expected_value), "Article image was found (schema:image).");
}