function StandardProfileTest::doTermRdfaTests
Same name in other branches
- 9 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::doTermRdfaTests()
Tests that term data is exposed on term page.
1 call to StandardProfileTest::doTermRdfaTests()
- StandardProfileTest::testRdfaOutput in core/
modules/ rdf/ tests/ src/ Functional/ StandardProfileTest.php - Tests that data is exposed correctly when using standard profile.
File
-
core/
modules/ rdf/ tests/ src/ Functional/ StandardProfileTest.php, line 316
Class
- StandardProfileTest
- Tests the RDF mappings and RDFa markup of the standard profile.
Namespace
Drupal\Tests\rdf\FunctionalCode
protected function doTermRdfaTests() {
// Term type.
$this->assertEqual($this->getElementRdfType($this->term
->toUrl(), $this->baseUri, $this->termUri), 'schema:Thing', 'Term type was found (schema:Thing) on term page.');
// Term name.
$expected_value = [
'type' => 'literal',
'value' => $this->term
->getName(),
'lang' => 'en',
];
$this->assertTrue($this->hasRdfProperty($this->getSession()
->getPage()
->getContent(), $this->baseUri, $this->termUri, 'http://schema.org/name', $expected_value), 'Term name was found (schema:name) on term page.');
// @todo Add test for term description once it is a field:
// https://www.drupal.org/node/569434.
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.