function UserAttributesTest::setUp

Same name in other branches
  1. 9 core/modules/rdf/tests/src/Functional/UserAttributesTest.php \Drupal\Tests\rdf\Functional\UserAttributesTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/rdf/tests/src/Functional/UserAttributesTest.php, line 37

Class

UserAttributesTest
Tests the RDFa markup of Users.

Namespace

Drupal\Tests\rdf\Functional

Code

protected function setUp() {
    parent::setUp();
    rdf_get_mapping('user', 'user')->setBundleMapping([
        'types' => [
            'sioc:UserAccount',
        ],
    ])
        ->setFieldMapping('name', [
        'properties' => [
            'foaf:name',
        ],
    ])
        ->save();
    // Prepares commonly used URIs.
    $this->baseUri = Url::fromRoute('<front>', [], [
        'absolute' => TRUE,
    ])->toString();
    // Set to test the altered display name.
    \Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
}

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