function StandardProfileTest::assertRdfaArticleProperties

Same name in other branches
  1. 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.

Parameters

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

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

File

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

Class

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

Namespace

Drupal\Tests\rdf\Functional

Code

protected function assertRdfaArticleProperties($message_prefix) {
    // 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->assertEqual($graph->type($this->termUri), 'schema:Thing', '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).");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.