function StandardProfileTest::doUserRdfaTests

Same name and namespace in other branches
  1. 8.9.x 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 338

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();
}

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