You are here

protected function StandardProfileTest::assertRdfaArticleProperties in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rdf/src/Tests/StandardProfileTest.php \Drupal\rdf\Tests\StandardProfileTest::assertRdfaArticleProperties()

Tests output for article properties displayed in both view modes.

Parameters

\EasyRdf_Graph $graph: The EasyRDF graph object.

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

2 calls to StandardProfileTest::assertRdfaArticleProperties()
StandardProfileTest::doArticleRdfaTests in core/modules/rdf/src/Tests/StandardProfileTest.php
Tests that article data is exposed using RDFa.
StandardProfileTest::doFrontPageRdfaTests in core/modules/rdf/src/Tests/StandardProfileTest.php
Tests that data is exposed in the front page teasers.

File

core/modules/rdf/src/Tests/StandardProfileTest.php, line 402
Contains \Drupal\rdf\Tests\StandardProfileTest.

Class

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

Namespace

Drupal\rdf\Tests

Code

protected function assertRdfaArticleProperties($graph, $message_prefix) {

  // Tags.
  $expected_value = array(
    'type' => 'uri',
    'value' => $this->termUri,
  );
  $this
    ->assertTrue($graph
    ->hasProperty($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->assertEqual($graph->type($this->termUri), 'schema:Thing', 'Tag type was found (schema:Thing).');

  // Tag name.
  $expected_value = array(
    '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).");
}