You are here

protected function OffCanvasTestBase::enableTheme in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php \Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase::enableTheme()
  2. 9 core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php \Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase::enableTheme()

Enables a theme.

Parameters

string $theme: The theme.

File

core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php, line 61

Class

OffCanvasTestBase
Base class contains common test functionality for the Off-canvas dialog.

Namespace

Drupal\Tests\system\FunctionalJavascript

Code

protected function enableTheme($theme) {

  // Enable the theme.
  \Drupal::service('theme_installer')
    ->install([
    $theme,
  ]);
  $theme_config = \Drupal::configFactory()
    ->getEditable('system.theme');
  $theme_config
    ->set('default', $theme);
  $theme_config
    ->save();
}