function EditorTest::createAnotherEntity

Same name in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/EditorTest.php \Drupal\Tests\jsonapi\Functional\EditorTest::createAnotherEntity()
  2. 10 core/modules/jsonapi/tests/src/Functional/EditorTest.php \Drupal\Tests\jsonapi\Functional\EditorTest::createAnotherEntity()
  3. 11.x core/modules/jsonapi/tests/src/Functional/EditorTest.php \Drupal\Tests\jsonapi\Functional\EditorTest::createAnotherEntity()

Overrides ResourceTestBase::createAnotherEntity

File

core/modules/jsonapi/tests/src/Functional/EditorTest.php, line 172

Class

EditorTest
JSON:API integration test for the "Editor" config entity type.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function createAnotherEntity($key) {
    FilterFormat::create([
        'name' => 'Pachyderm',
        'format' => 'pachyderm',
        'langcode' => 'fr',
        'filters' => [
            'filter_html' => [
                'status' => TRUE,
                'settings' => [
                    'allowed_html' => '<p> <a> <b> <lo>',
                ],
            ],
        ],
    ])->save();
    $entity = Editor::create([
        'format' => 'pachyderm',
        'editor' => 'ckeditor5',
    ]);
    $entity->setImageUploadSettings([
        'status' => FALSE,
        'scheme' => 'public',
        'directory' => 'inline-images',
        'max_size' => '',
        'max_dimensions' => [
            'width' => '',
            'height' => '',
        ],
    ])
        ->save();
    return $entity;
}

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