function PageNotFoundTest::setUp
Same name in other branches
- 9 core/modules/system/tests/src/Functional/System/PageNotFoundTest.php \Drupal\Tests\system\Functional\System\PageNotFoundTest::setUp()
- 8.9.x core/modules/system/tests/src/Functional/System/PageNotFoundTest.php \Drupal\Tests\system\Functional\System\PageNotFoundTest::setUp()
- 11.x core/modules/system/tests/src/Functional/System/PageNotFoundTest.php \Drupal\Tests\system\Functional\System\PageNotFoundTest::setUp()
Overrides BrowserTestBase::setUp
File
-
core/
modules/ system/ tests/ src/ Functional/ System/ PageNotFoundTest.php, line 35
Class
- PageNotFoundTest
- Tests page not found functionality, including custom 404 pages.
Namespace
Drupal\Tests\system\Functional\SystemCode
protected function setUp() : void {
parent::setUp();
// Create an administrative user.
$this->adminUser = $this->drupalCreateUser([
'administer site configuration',
'link to any page',
]);
$this->adminUser->roles[] = 'administrator';
$this->adminUser
->save();
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, [
'access user profiles',
]);
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, [
'access user profiles',
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.