You are here

protected function SearchAdminThemeTest::setUp in Drupal 9

Overrides BrowserTestBase::setUp

File

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

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 user profiles',
    'view the administration theme',
  ]);

  // Log in with sufficient privileges.
  $this
    ->drupalLogin($user);
}