function OffCanvasTestBase::enableTheme

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php \Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase::enableTheme()
  2. 10 core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php \Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase::enableTheme()
  3. 8.9.x core/modules/system/tests/src/FunctionalJavascript/OffCanvasTestBase.php \Drupal\Tests\system\FunctionalJavascript\OffCanvasTestBase::enableTheme()

Enables a theme.

Parameters

string $theme: The theme.

3 calls to OffCanvasTestBase::enableTheme()
SettingsTrayBlockFormTest::doTestBlocks in core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
Tests opening off-canvas dialog by click blocks and elements in the blocks.
SettingsTrayBlockFormTest::testEditModeEnableDisable in core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
Tests enabling and disabling Edit Mode.
SettingsTrayBlockFormTest::testValidationMessages in core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php
Tests that validation errors appear in the off-canvas dialog.

File

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

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();
}

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