public function CKEditorTest::testJSTranslation in Drupal 10
Same name and namespace in other branches
- 8 core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php \Drupal\Tests\ckeditor\Kernel\CKEditorTest::testJSTranslation()
- 9 core/modules/ckeditor/tests/src/Kernel/CKEditorTest.php \Drupal\Tests\ckeditor\Kernel\CKEditorTest::testJSTranslation()
Tests that CKEditor plugins participate in JS translation.
File
- core/
modules/ ckeditor/ tests/ src/ Kernel/ CKEditorTest.php, line 417
Class
- CKEditorTest
- Tests for the 'CKEditor' text editor plugin.
Namespace
Drupal\Tests\ckeditor\KernelCode
public function testJSTranslation() {
$this
->enableModules([
'language',
'locale',
]);
$this
->installSchema('locale', 'locales_source');
$this
->installSchema('locale', 'locales_location');
$this
->installSchema('locale', 'locales_target');
$editor = Editor::load('filtered_html');
$this->ckeditor
->getJSSettings($editor);
$localeStorage = $this->container
->get('locale.storage');
$string = $localeStorage
->findString([
'source' => 'Edit Link',
'context' => '',
]);
$this
->assertNotEmpty($string, 'String from JavaScript file saved.');
// With locale module, CKEditor should not adhere to the language selected.
$this
->assertCKEditorLanguage();
}