You are here

protected function Domain301RedirectTest::setUp in Domain 301 Redirect 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/Domain301RedirectTest.php, line 37

Class

Domain301RedirectTest
Test the redirection of a domain using the DomainRedirectEventSubscriber.

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->redirectDomain = "http://redirect.{$host}/";
  $this->secureDomain = "https://{$host}/";
  parent::setUp();
  $this->configFactory = Drupal::service('config.factory');
}