function CKEditor5QuickEditLibraryTest::setUp

Overrides BrowserTestBase::setUp

File

core/modules/quickedit/tests/src/Functional/CKEditor5/CKEditor5QuickEditLibraryTest.php, line 45

Class

CKEditor5QuickEditLibraryTest
Tests that a Quick Edit specific library loads when Quick Edit is enabled.

Namespace

Drupal\Tests\quickedit\Functional\CKEditor5

Code

protected function setUp() : void {
    parent::setUp();
    $format = FilterFormat::create([
        'format' => 'llama',
        'name' => 'Llama',
        'filters' => [],
        'roles' => [
            RoleInterface::AUTHENTICATED_ID,
        ],
    ]);
    $format->save();
    $editor = Editor::create([
        'format' => 'llama',
        'editor' => 'ckeditor5',
        'settings' => [
            'toolbar' => [
                'items' => [],
            ],
        ],
    ]);
    $editor->save();
    $this->assertSame([], array_map(function (ConstraintViolation $v) {
        return (string) $v->getMessage();
    }, iterator_to_array(CKEditor5::validatePair($editor, $format))));
    $this->drupalCreateContentType([
        'type' => 'article',
        'name' => 'Article',
    ]);
    $this->adminUser = $this->drupalCreateUser([
        'create article content',
        'use text format llama',
    ]);
    $this->drupalLogin($this->adminUser);
}

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