function FieldUiIntegrationTest::setUp

Same name in other branches
  1. 9 core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php \Drupal\Tests\media_library\FunctionalJavascript\FieldUiIntegrationTest::setUp()
  2. 8.9.x core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php \Drupal\Tests\media_library\FunctionalJavascript\FieldUiIntegrationTest::setUp()
  3. 10 core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php \Drupal\Tests\media_library\FunctionalJavascript\FieldUiIntegrationTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/media_library/tests/src/FunctionalJavascript/FieldUiIntegrationTest.php, line 34

Class

FieldUiIntegrationTest
Tests field UI integration for media library widget.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

protected function setUp() : void {
    parent::setUp();
    $this->drupalPlaceBlock('local_tasks_block');
    // Create a user who can add media fields.
    $user = $this->drupalCreateUser([
        'access administration pages',
        'administer node fields',
        'administer node form display',
    ]);
    $this->drupalLogin($user);
    $this->drupalCreateContentType([
        'type' => 'article',
    ]);
    $this->drupalCreateContentType([
        'type' => 'page',
    ]);
    $this->createMediaItems([
        'type_one' => [
            'Horse',
            'Bear',
            'Cat',
            'Dog',
        ],
    ]);
}

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