You are here

protected function ImageUploadTest::createEditorWithUpload in Drupal 10

Create an editor entity with image_upload config.

Parameters

array $upload_config: The editor image_upload config.

Return value

\Drupal\Core\Entity\EntityBase|\Drupal\Core\Entity\EntityInterface The text editor entity.

Throws

\Drupal\Core\Entity\EntityStorageException

File

core/modules/ckeditor5/tests/src/Functional/ImageUploadTest.php, line 217

Class

ImageUploadTest
Test image upload.

Namespace

Drupal\Tests\ckeditor5\Functional

Code

protected function createEditorWithUpload(array $upload_config) {
  $editor = Editor::create([
    'editor' => 'ckeditor5',
    'format' => 'basic_html',
    'settings' => [
      'toolbar' => [
        'items' => [
          'uploadImage',
        ],
      ],
      'plugins' => [],
    ],
    'image_upload' => $upload_config,
  ]);
  $editor
    ->save();
  return $editor;
}