function QuickEditImageControllerTest::setUp

Same name and namespace in other branches
  1. 8.9.x core/modules/image/tests/src/Functional/QuickEditImageControllerTest.php \Drupal\Tests\image\Functional\QuickEditImageControllerTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/quickedit/tests/src/Functional/QuickEditImageControllerTest.php, line 50

Class

QuickEditImageControllerTest
Tests the endpoints used by the "image" in-place editor.

Namespace

Drupal\Tests\quickedit\Functional

Code

protected function setUp() : void {
    parent::setUp();
    // Create the Article node type.
    $this->drupalCreateContentType([
        'type' => 'article',
        'name' => 'Article',
    ]);
    // Log in as a content author who can use Quick Edit and edit Articles.
    $this->contentAuthorUser = $this->drupalCreateUser([
        'access contextual links',
        'access in-place editing',
        'access content',
        'create article content',
        'edit any article content',
        'delete any article content',
    ]);
    $this->drupalLogin($this->contentAuthorUser);
    // Create a field with basic resolution validators.
    $this->fieldName = strtolower($this->randomMachineName());
    $field_settings = [
        'max_resolution' => '100x',
        'min_resolution' => '50x',
    ];
    $this->createImageField($this->fieldName, 'article', [], $field_settings);
}

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