You are here

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

Tests that user data is exposed on user page.

File

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

Class

StandardProfileTest
Tests the RDF mappings and RDFa markup on top 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();
}