You are here

protected function AdminTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/System/AdminTest.php \Drupal\Tests\system\Functional\System\AdminTest::setUp()
  2. 9 core/modules/system/tests/src/Functional/System/AdminTest.php \Drupal\Tests\system\Functional\System\AdminTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/system/tests/src/Functional/System/AdminTest.php, line 41

Class

AdminTest
Tests output on administrative pages and compact mode functionality.

Namespace

Drupal\Tests\system\Functional\System

Code

protected function setUp() : void {

  // testAdminPages() requires Locale module.
  parent::setUp();

  // Create an administrator with all permissions, as well as a regular user
  // who can only access administration pages and perform some Locale module
  // administrative tasks, but not all of them.
  $this->adminUser = $this
    ->drupalCreateUser(array_keys(\Drupal::service('user.permissions')
    ->getPermissions()));
  $this->webUser = $this
    ->drupalCreateUser([
    'access administration pages',
    'translate interface',
  ]);
  $this
    ->drupalLogin($this->adminUser);
}