You are here

protected function MediaImageFieldTest::setUp in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/FunctionalJavascript/MediaImageFieldTest.php \Drupal\Tests\lightning_media\FunctionalJavascript\MediaImageFieldTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/FunctionalJavascript/MediaImageFieldTest.php, line 33

Class

MediaImageFieldTest
Tests interactions with image fields attached to media types.

Namespace

Drupal\Tests\lightning_media\FunctionalJavascript

Code

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

  // The media.settings:standalone_url setting was added in Drupal 8.7. To
  // avoid config schema errors, we should only set the option if it actually
  // exists to begin with.
  $settings = $this
    ->config('media.settings');
  if ($settings
    ->get('standalone_url') === FALSE) {
    $settings
      ->set('standalone_url', TRUE)
      ->save();

    // Flush all caches to rebuild the entity type definitions and routing
    // tables, which will expose the canonical media entity route.
    drupal_flush_all_caches();
  }
}