function UserPermissionsTest::setUp

Same name in this branch
  1. 9 core/modules/user/tests/src/Functional/UserPermissionsTest.php \Drupal\Tests\user\Functional\UserPermissionsTest::setUp()
Same name in other branches
  1. 8.9.x core/modules/user/tests/src/Functional/UserPermissionsTest.php \Drupal\Tests\user\Functional\UserPermissionsTest::setUp()
  2. 10 core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php \Drupal\Tests\user\FunctionalJavascript\UserPermissionsTest::setUp()
  3. 10 core/modules/user/tests/src/Functional/UserPermissionsTest.php \Drupal\Tests\user\Functional\UserPermissionsTest::setUp()
  4. 11.x core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php \Drupal\Tests\user\FunctionalJavascript\UserPermissionsTest::setUp()
  5. 11.x core/modules/user/tests/src/Functional/UserPermissionsTest.php \Drupal\Tests\user\Functional\UserPermissionsTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php, line 37

Class

UserPermissionsTest
Tests the JS components added to the user permissions page.

Namespace

Drupal\Tests\user\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    $this->adminUser = $this->drupalCreateUser([
        'administer permissions',
    ]);
    // Find the new role ID.
    $all_rids = $this->adminUser
        ->getRoles();
    unset($all_rids[array_search(RoleInterface::AUTHENTICATED_ID, $all_rids)]);
    $this->rid = reset($all_rids);
}

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