You are here

protected function RedirectManagerTest::setUp in Domain 301 Redirect 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/RedirectManagerTest.php, line 43

Class

RedirectManagerTest
Test the Domain301RedirectManager service.

Namespace

Drupal\Tests\domain_301_redirect\Functional

Code

protected function setUp() {
  $test_url = getenv('SIMPLETEST_BASE_URL');
  $parsed_url = parse_url($test_url);
  if (!isset($parsed_url['host'])) {
    $this
      ->markTestSkipped('Missing SIMPLETEST_BASE_URL');
    return;
  }
  $host = trim($parsed_url['host'], '/');
  $this->domain = "http://{$host}/";
  $this->notTheDomain = "http://not.{$host}/";
  parent::setUp();
  $this->configFactory = Drupal::service('config.factory');
  $this->redirectManager = Drupal::service('domain_301_redirect.manager');
}