Reset force SSL domain/patterns in setup to prevent global state pollution

This commit is contained in:
Robbie Averill 2018-05-29 17:34:22 +12:00
parent 063d765e94
commit 7a8a24d175

View File

@ -31,8 +31,13 @@ class DirectorTest extends SapphireTest
Director::config()->set('alternate_base_url', 'http://www.mysite.com:9090/');
// Ensure redirects enabled on all environments
CanonicalURLMiddleware::singleton()->setEnabledEnvs(true);
$middleware = CanonicalURLMiddleware::singleton()->setEnabledEnvs(true);
$this->expectedRedirect = null;
// Ensure global state doesn't affect this test
$middleware
->setForceSSLDomain(null)
->setForceSSLPatterns([]);
}
protected function getExtraRoutes()