CKEditor5StylesheetsTest.php in Drupal 10
File
core/modules/ckeditor5/tests/src/Kernel/CKEditor5StylesheetsTest.php
View source
<?php
declare (strict_types=1);
namespace Drupal\Tests\ckeditor5\Kernel;
use Drupal\KernelTests\KernelTestBase;
class CKEditor5StylesheetsTest extends KernelTestBase {
protected static $modules = [
'system',
'user',
'ckeditor5',
'editor',
'filter',
];
public function testExternalStylesheets($theme, $expected) {
\Drupal::service('theme_installer')
->install([
$theme,
]);
$this
->config('system.theme')
->set('default', $theme)
->save();
$this
->assertSame($expected, _ckeditor5_theme_css($theme));
}
public function externalStylesheetsProvider() {
return [
'Install theme which has an absolute external CSS URL' => [
'test_ckeditor_stylesheets_external',
[
'https://fonts.googleapis.com/css?family=Open+Sans',
],
],
'Install theme which has an external protocol-relative CSS URL' => [
'test_ckeditor_stylesheets_protocol_relative',
[
'//fonts.googleapis.com/css?family=Open+Sans',
],
],
'Install theme which has a relative CSS URL' => [
'test_ckeditor_stylesheets_relative',
[
'/core/modules/system/tests/themes/test_ckeditor_stylesheets_relative/css/yokotsoko.css',
],
],
'Install theme which has a Drupal root CSS URL' => [
'test_ckeditor_stylesheets_drupal_root',
[
'/core/modules/system/tests/themes/test_ckeditor_stylesheets_drupal_root/css/yokotsoko.css',
],
],
];
}
}