function SearchAdminThemeTest::setUp

Same name in other branches
  1. 9 core/modules/search/tests/src/Functional/SearchAdminThemeTest.php \Drupal\Tests\search\Functional\SearchAdminThemeTest::setUp()
  2. 11.x core/modules/search/tests/src/Functional/SearchAdminThemeTest.php \Drupal\Tests\search\Functional\SearchAdminThemeTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/search/tests/src/Functional/SearchAdminThemeTest.php, line 46

Class

SearchAdminThemeTest
Verify the search results using administration theme for specific plugins.

Namespace

Drupal\Tests\search\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Install an administration theme to make sure it used for search results.
    \Drupal::service('theme_installer')->install([
        $this->adminTheme,
    ]);
    \Drupal::configFactory()->getEditable('system.theme')
        ->set('admin', $this->adminTheme)
        ->save();
    // Create searching user.
    $user = $this->drupalCreateUser([
        'access content',
        'search content',
        'access help pages',
        'access user profiles',
        'view the administration theme',
    ]);
    // Log in with sufficient privileges.
    $this->drupalLogin($user);
}

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