You are here

protected function MediaBulkFormTest::setUp in Media Entity Actions 8

Same name and namespace in other branches
  1. 8.2 tests/src/Functional/MediaEntityActionsBulkFormTest.php \Drupal\Tests\media_entity_actions\Functional\MediaBulkFormTest::setUp()

Overrides MediaFunctionalTestTrait::setUp

File

tests/src/Functional/MediaEntityActionsBulkFormTest.php, line 40

Class

MediaBulkFormTest
Tests a media bulk form.

Namespace

Drupal\Tests\media_entity_actions\Functional

Code

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

  // 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;
  }
}