protected function StandardProfileTest::doTermRdfaTests in Drupal 9
Same name and namespace in other branches
- 8 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::doTermRdfaTests()
- 10 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
->assertEquals('schema:Thing', $this
->getElementRdfType($this->term
->toUrl(), $this->baseUri, $this->termUri), '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.
}