function MediaFunctionalTestTrait::setUp

Same name in other branches
  1. 9 core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php \Drupal\Tests\media\Functional\MediaFunctionalTestTrait::setUp()
  2. 10 core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php \Drupal\Tests\media\Functional\MediaFunctionalTestTrait::setUp()
  3. 11.x core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php \Drupal\Tests\media\Functional\MediaFunctionalTestTrait::setUp()
13 calls to MediaFunctionalTestTrait::setUp()
MediaAccessTest::setUp in core/modules/media/tests/src/Functional/MediaAccessTest.php
MediaBulkFormTest::setUp in core/modules/media/tests/src/Functional/MediaBulkFormTest.php
MediaDisplayTest::setUp in core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
MediaEmbedFilterConfigurationUiTest::setUp in core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php
MediaOverviewPageTest::setUp in core/modules/media/tests/src/Functional/MediaOverviewPageTest.php

... See full list

13 methods override MediaFunctionalTestTrait::setUp()
MediaAccessTest::setUp in core/modules/media/tests/src/Functional/MediaAccessTest.php
MediaBulkFormTest::setUp in core/modules/media/tests/src/Functional/MediaBulkFormTest.php
MediaDisplayTest::setUp in core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php
MediaEmbedFilterConfigurationUiTest::setUp in core/modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php
MediaOverviewPageTest::setUp in core/modules/media/tests/src/Functional/MediaOverviewPageTest.php

... See full list

File

core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php, line 59

Class

MediaFunctionalTestTrait
Trait with helpers for Media functional tests.

Namespace

Drupal\Tests\media\Functional

Code

protected function setUp() {
    parent::setUp();
    // Have two users ready to be used in tests.
    $this->adminUser = $this->drupalCreateUser(static::$adminUserPermissions);
    $this->nonAdminUser = $this->drupalCreateUser([]);
    // Start off logged in as admin.
    $this->drupalLogin($this->adminUser);
    $this->storage = $this->container
        ->get('entity_type.manager')
        ->getStorage('media');
}

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