You are here

protected function StandardProfileTest::doUserRdfaTests in Drupal 9

Same name and namespace in other branches
  1. 8 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
    ->assertEquals('schema:Person', $this
    ->getElementRdfType($this->adminUser
    ->toUrl(), $this->baseUri, $this->authorUri), '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();
}