You are here

protected function MediaFunctionalTestTrait::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php \Drupal\Tests\media\Functional\MediaFunctionalTestTrait::setUp()
  2. 9 core/modules/media/tests/src/Functional/MediaFunctionalTestTrait.php \Drupal\Tests\media\Functional\MediaFunctionalTestTrait::setUp()
1 method overrides MediaFunctionalTestTrait::setUp()
OEmbedFormatterTest::setUp in core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php

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() : void {
  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');
}