You are here

protected function MediaBulkFormTest::setUp in Drupal 9

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

Overrides MediaFunctionalTestTrait::setUp

File

core/modules/media/tests/src/Functional/MediaBulkFormTest.php, line 44

Class

MediaBulkFormTest
Tests a media bulk form.

Namespace

Drupal\Tests\media\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $this->testMediaType = $this
    ->createMediaType('test');

  // Create some test media items.
  $this->mediaItems = [];
  for ($i = 1; $i <= 5; $i++) {
    $media = Media::create([
      'bundle' => $this->testMediaType
        ->id(),
    ]);
    $media
      ->save();
    $this->mediaItems[] = $media;
  }
}