function UserPermissionsTest::setUp
Same name in this branch
- 10 core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php \Drupal\Tests\user\FunctionalJavascript\UserPermissionsTest::setUp()
Same name in other branches
- 9 core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php \Drupal\Tests\user\FunctionalJavascript\UserPermissionsTest::setUp()
- 9 core/modules/user/tests/src/Functional/UserPermissionsTest.php \Drupal\Tests\user\Functional\UserPermissionsTest::setUp()
- 8.9.x core/modules/user/tests/src/Functional/UserPermissionsTest.php \Drupal\Tests\user\Functional\UserPermissionsTest::setUp()
- 11.x core/modules/user/tests/src/FunctionalJavascript/UserPermissionsTest.php \Drupal\Tests\user\FunctionalJavascript\UserPermissionsTest::setUp()
- 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/ Functional/ UserPermissionsTest.php, line 43
Class
- UserPermissionsTest
- Verifies role permissions can be added and removed via the permissions page.
Namespace
Drupal\Tests\user\FunctionalCode
protected function setUp() : void {
parent::setUp();
$this->adminUser = $this->drupalCreateUser([
'administer permissions',
'access user profiles',
'administer site configuration',
'administer modules',
'administer account settings',
]);
// 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.