function CKEditor5StylesheetsTest::testExternalStylesheets

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5StylesheetsTest::testExternalStylesheets()
  2. 11.x core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5StylesheetsTest::testExternalStylesheets()

Tests loading of theme's CKEditor 5 stylesheets defined in the .info file.

@dataProvider externalStylesheetsProvider

Parameters

string $theme: The machine name of the theme.

array $expected: The expected CKEditor 5 CSS paths from the theme.

File

core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php, line 37

Class

CKEditor5StylesheetsTest
Test the ckeditor5-stylesheets theme config property.

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

public function testExternalStylesheets($theme, $expected) : void {
    \Drupal::service('theme_installer')->install([
        $theme,
    ]);
    $this->config('system.theme')
        ->set('default', $theme)
        ->save();
    $this->assertSame($expected, _ckeditor5_theme_css($theme));
}

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