function EditorValidationTest::setUp

Same name and namespace in other branches
  1. 10 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 38

Class

EditorValidationTest
Tests validation of editor entities.

Namespace

Drupal\Tests\editor\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $format = FilterFormat::create([
        'format' => 'test',
        'name' => 'Test',
    ]);
    $format->save();
    $this->entity = Editor::create([
        'format' => $format->id(),
        'editor' => 'ckeditor5',
        'image_upload' => [
            'status' => FALSE,
        ],
        '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.