function MediaBulkFormTest::setUp

Same name in other branches
  1. 9 core/modules/media/tests/src/Functional/MediaBulkFormTest.php \Drupal\Tests\media\Functional\MediaBulkFormTest::setUp()
  2. 10 core/modules/media/tests/src/Functional/MediaBulkFormTest.php \Drupal\Tests\media\Functional\MediaBulkFormTest::setUp()
  3. 11.x 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() {
    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;
    }
}

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