You are here

protected function MediaDisplayTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php \Drupal\Tests\media\FunctionalJavascript\MediaDisplayTest::setUp()

Overrides MediaFunctionalTestTrait::setUp

File

core/modules/media/tests/src/FunctionalJavascript/MediaDisplayTest.php, line 28

Class

MediaDisplayTest
Basic display tests for Media.

Namespace

Drupal\Tests\media\FunctionalJavascript

Code

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

  // Install the optional configs from the standard profile.
  $extension_path = $this->container
    ->get('extension.list.profile')
    ->getPath('standard');
  $optional_install_path = $extension_path . '/' . InstallStorage::CONFIG_OPTIONAL_DIRECTORY;
  $storage = new FileStorage($optional_install_path);
  $this->container
    ->get('config.installer')
    ->installOptionalConfig($storage, '');

  // Reset all the static caches and list caches.
  $this->container
    ->get('config.factory')
    ->reset();

  // This test is going to test the display, so we need the standalone URL.
  \Drupal::configFactory()
    ->getEditable('media.settings')
    ->set('standalone_url', TRUE)
    ->save(TRUE);
  $this->container
    ->get('router.builder')
    ->rebuild();
}