You are here

protected function StandardProfileTest::doTermRdfaTests in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::doTermRdfaTests()
  2. 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\Functional

Code

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.
}