function OffCanvasTestBase::enableTheme

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

Enables a theme.

Parameters

string $theme: The theme.

5 calls to OffCanvasTestBase::enableTheme()
OffCanvasTest::testNarrowWidth in core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
Tests the body displacement behaves differently at a narrow width.
OffCanvasTest::testOffCanvasLinks in core/modules/system/tests/src/FunctionalJavascript/OffCanvasTest.php
Tests that non-contextual links will work with the off-canvas dialog.
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 64

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.