You are here

protected function MediaOverviewTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php \Drupal\Tests\media_library\FunctionalJavascript\MediaOverviewTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/media_library/tests/src/FunctionalJavascript/MediaOverviewTest.php, line 20

Class

MediaOverviewTest
Tests the grid-style media overview page.

Namespace

Drupal\Tests\media_library\FunctionalJavascript

Code

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

  // Create a few example media items for use in selection.
  $this
    ->createMediaItems([
    'type_one' => [
      'Horse',
      'Bear',
      'Cat',
      'Dog',
    ],
    'type_two' => [
      'Crocodile',
      'Lizard',
      'Snake',
      'Turtle',
    ],
  ]);
  $this
    ->drupalPlaceBlock('local_tasks_block');
  $this
    ->drupalPlaceBlock('local_actions_block');
  $user = $this
    ->drupalCreateUser([
    'access media overview',
    'create media',
    'delete any media',
    'update any media',
  ]);
  $this
    ->drupalLogin($user);
}