function UserAttributesTest::setUp

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

Class

UserAttributesTest
Tests the RDFa markup of Users.

Namespace

Drupal\Tests\rdf\Functional

Code

protected function setUp() : void {
  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.