You are here

protected function StandardProfileTest::assertRdfaArticleProperties in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::assertRdfaArticleProperties()
  2. 9 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::assertRdfaArticleProperties()

Tests output for article properties displayed in both view modes.

@internal

Parameters

string $message_prefix: The word to use in the test assertion message.

File

core/modules/rdf/tests/src/Functional/StandardProfileTest.php, line 438

Class

StandardProfileTest
Tests the RDF mappings and RDFa markup on top of the standard profile.

Namespace

Drupal\Tests\rdf\Functional

Code

protected function assertRdfaArticleProperties(string $message_prefix) : void {

  // Tags.
  $expected_value = [
    'type' => 'uri',
    'value' => $this->termUri,
  ];
  $this
    ->assertTrue($this
    ->hasRdfProperty($this
    ->getSession()
    ->getPage()
    ->getContent(), $this->baseUri, $this->articleUri, 'http://schema.org/about', $expected_value), "{$message_prefix} tag was found (schema:about).");

  // Tag type.
  // @todo Enable with https://www.drupal.org/node/2072791.
  // $this->assertEquals('schema:Thing', $graph->type($this->termUri), 'Tag type was found (schema:Thing).');
  // Tag name.
  $expected_value = [
    'type' => 'literal',
    'value' => $this->term
      ->getName(),
    'lang' => 'en',
  ];

  // @todo Enable with https://www.drupal.org/node/2072791.
  // $this->assertTrue($graph->hasProperty($this->termUri, 'http://schema.org/name', $expected_value), "$message_prefix name was found (schema:name).");
}