You are here

protected function StandardProfileTest::doUserRdfaTests 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::doUserRdfaTests()
  2. 10 core/modules/rdf/tests/src/Functional/StandardProfileTest.php \Drupal\Tests\rdf\Functional\StandardProfileTest::doUserRdfaTests()

Tests that user data is exposed on user page.

1 call to StandardProfileTest::doUserRdfaTests()
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 297

Class

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

Namespace

Drupal\Tests\rdf\Functional

Code

protected function doUserRdfaTests() {
  $this
    ->drupalLogin($this->rootUser);

  // User type.
  $this
    ->assertEqual($this
    ->getElementRdfType($this->adminUser
    ->toUrl(), $this->baseUri, $this->authorUri), 'schema:Person', 'User type was found (schema:Person) on user page.');

  // User name.
  $expected_value = [
    'type' => 'literal',
    'value' => $this->adminUser
      ->label(),
  ];
  $this
    ->assertTrue($this
    ->hasRdfProperty($this
    ->getSession()
    ->getPage()
    ->getContent(), $this->baseUri, $this->authorUri, 'http://schema.org/name', $expected_value), 'User name was found (schema:name) on user page.');
  $this
    ->drupalLogout();
}