protected function Domain301RedirectFunctionalTestTrait::enableRedirect in Domain 301 Redirect 8
Enable the 301 redirect for the provided domain.
Parameters
string $domain: The domain to set in domain_301_redirect.settings.
3 calls to Domain301RedirectFunctionalTestTrait::enableRedirect()
- Domain301RedirectTest::testDomainRedirect in tests/
src/ Functional/ Domain301RedirectTest.php - Test redirecting to various domains.
- Domain301RedirectTest::testRedirectCacheability in tests/
src/ Functional/ Domain301RedirectTest.php - Test the cacheability of the redirect response.
- RedirectManagerTest::testCheckDomain in tests/
src/ Functional/ RedirectManagerTest.php - Check that the the redirect domain resolves to this site.
File
- tests/
src/ Traits/ Domain301RedirectFunctionalTestTrait.php, line 16
Class
- Domain301RedirectFunctionalTestTrait
- Common functions used by domain_301_redirect tests.
Namespace
Drupal\Tests\domain_301_redirect\TraitsCode
protected function enableRedirect($domain) {
$config = $this->configFactory
->getEditable('domain_301_redirect.settings');
$config
->merge([
'enabled' => 1,
'domain' => $domain,
])
->save();
drupal_flush_all_caches();
}