function CKEditor5ToolbarTest::setUp

Same name in other branches
  1. 10 core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ToolbarTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5ToolbarTest::setUp()
  2. 11.x core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ToolbarTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\CKEditor5ToolbarTest::setUp()

Overrides CKEditor5TestBase::setUp

File

core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5ToolbarTest.php, line 37

Class

CKEditor5ToolbarTest
Tests for CKEditor 5 editor UI with Toolbar module.

Namespace

Drupal\Tests\ckeditor5\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    FilterFormat::create([
        'format' => 'test_format',
        'name' => 'Test format',
        'filters' => [],
    ])->save();
    Editor::create([
        'editor' => 'ckeditor5',
        'format' => 'test_format',
        'settings' => [],
    ])->save();
    $this->assertSame([], array_map(function (ConstraintViolation $v) {
        return (string) $v->getMessage();
    }, iterator_to_array(CKEditor5::validatePair(Editor::load('test_format'), FilterFormat::load('test_format')))));
    $this->drupalCreateContentType([
        'type' => 'article',
        'name' => 'Article',
    ]);
    $this->user = $this->drupalCreateUser([
        'use text format test_format',
        'access toolbar',
        'edit any article content',
        'administer site configuration',
    ]);
    $this->drupalLogin($this->user);
}

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