function EditorValidationTest::setUp
Same name in other branches
- 11.x core/modules/editor/tests/src/Kernel/EditorValidationTest.php \Drupal\Tests\editor\Kernel\EditorValidationTest::setUp()
Overrides ConfigEntityValidationTestBase::setUp
File
-
core/
modules/ editor/ tests/ src/ Kernel/ EditorValidationTest.php, line 39
Class
- EditorValidationTest
- Tests validation of editor entities.
Namespace
Drupal\Tests\editor\KernelCode
protected function setUp() : void {
parent::setUp();
$format = FilterFormat::create([
'format' => 'test',
'name' => 'Test',
]);
$format->save();
$this->entity = Editor::create([
'format' => $format->id(),
'editor' => 'ckeditor5',
'settings' => [
// @see \Drupal\ckeditor5\Plugin\Editor\CKEditor5::getDefaultSettings()
'toolbar' => [
'items' => [
'heading',
'bold',
'italic',
],
],
'plugins' => [
'ckeditor5_heading' => Heading::DEFAULT_CONFIGURATION,
],
],
]);
$this->entity
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.