function EditorUploadImageScaleTest::setUp

Same name in other branches
  1. 9 core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php \Drupal\Tests\editor\Functional\EditorUploadImageScaleTest::setUp()
  2. 10 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 42

Class

EditorUploadImageScaleTest
Tests scaling of inline images.

Namespace

Drupal\Tests\editor\Functional

Code

protected function setUp() {
    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);
}

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