You are here

protected function SoundcloudEmbedFormatterTest::setUp in Media entity Soundcloud 3.x

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

Overrides BrowserTestBase::setUp

File

tests/src/Functional/SoundcloudEmbedFormatterTest.php, line 35

Class

SoundcloudEmbedFormatterTest
Tests for Soundcloud embed formatter.

Namespace

Drupal\Tests\media_entity_soundcloud\Functional

Code

protected function setUp() {
  parent::setUp();

  // Setup standalone media urls from the settings.
  $this
    ->config('media.settings')
    ->set('standalone_url', true)
    ->save();
  $this
    ->refreshVariables();

  // Rebuild routes.
  \Drupal::service('router.builder')
    ->rebuild();

  // Create an admin user with permissions to administer and create media.
  $account = $this
    ->drupalCreateUser([
    // Media entity permissions.
    'view media',
    'create media',
    'update media',
    'update any media',
    'delete media',
    'delete any media',
  ]);

  // Login the user.
  $this
    ->drupalLogin($account);
}