You are here

protected function EditorTest::createAnotherEntity in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Functional/EditorTest.php \Drupal\Tests\jsonapi\Functional\EditorTest::createAnotherEntity()
  2. 9 core/modules/jsonapi/tests/src/Functional/EditorTest.php \Drupal\Tests\jsonapi\Functional\EditorTest::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;
}