function CKEditorStylesheetsWarningTest::installThemeThatTriggersWarning

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditorStylesheetsWarningTest::installThemeThatTriggersWarning()
  2. 10 core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditorStylesheetsWarningTest::installThemeThatTriggersWarning()

Installs and enables themes for testing.

Parameters

string $theme: The theme to enable.

1 call to CKEditorStylesheetsWarningTest::installThemeThatTriggersWarning()
CKEditorStylesheetsWarningTest::testWarningFilterUi in core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php
Test the ckeditor_stylesheets warning in the filter UI.

File

core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditorStylesheetsWarningTest.php, line 30

Class

CKEditorStylesheetsWarningTest
Tests warnings when ckeditor_stylesheets do not have CKEditor 5 equivalents.

Namespace

Drupal\Tests\ckeditor5\FunctionalJavascript

Code

public function installThemeThatTriggersWarning($theme) {
    $theme_installer = \Drupal::service('theme_installer');
    $theme_installer->install([
        $theme,
    ]);
    $this->config('system.theme')
        ->set('default', $theme)
        ->save();
    $theme_installer->install([
        'stark',
    ]);
    $this->config('system.theme')
        ->set('admin', 'stark')
        ->save();
    \Drupal::service('theme_handler')->refreshInfo();
}

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