You are here

protected function EditorUploadImageScaleTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php \Drupal\Tests\editor\Functional\EditorUploadImageScaleTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php, line 41

Class

EditorUploadImageScaleTest
Tests scaling of inline images.

Namespace

Drupal\Tests\editor\Functional

Code

protected function setUp() : void {
  parent::setUp();

  // Add text format.
  FilterFormat::create([
    'format' => 'basic_html',
    'name' => 'Basic HTML',
    'weight' => 0,
  ])
    ->save();

  // Set up text editor.
  Editor::create([
    'format' => 'basic_html',
    'editor' => 'unicorn',
    'image_upload' => [
      'status' => TRUE,
      'scheme' => 'public',
      'directory' => 'inline-images',
      'max_size' => '',
      'max_dimensions' => [
        'width' => NULL,
        'height' => NULL,
      ],
    ],
  ])
    ->save();

  // Create admin user.
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer filters',
    'use text format basic_html',
  ]);
  $this
    ->drupalLogin($this->adminUser);
}