protected function StandardProfileTest::doTermRdfaTests in Drupal 10
Same name and namespace in other branches
- 8 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::doTermRdfaTests()
- 9 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::doTermRdfaTests()
Tests that term data is exposed on term page.
File
- core/modules/ rdf/ tests/ src/ Functional/ StandardProfileTest.php, line 356 
Class
- StandardProfileTest
- Tests the RDF mappings and RDFa markup on top 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.
}