mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Use chaining syntax for setting up middleware
This commit is contained in:
parent
48304fd6f0
commit
1d6d601050
@ -30,14 +30,12 @@ class DirectorTest extends SapphireTest
|
|||||||
parent::setUp();
|
parent::setUp();
|
||||||
Director::config()->set('alternate_base_url', 'http://www.mysite.com:9090/');
|
Director::config()->set('alternate_base_url', 'http://www.mysite.com:9090/');
|
||||||
|
|
||||||
// Ensure redirects enabled on all environments
|
// Ensure redirects enabled on all environments and global state doesn't affect the tests
|
||||||
$middleware = CanonicalURLMiddleware::singleton()->setEnabledEnvs(true);
|
CanonicalURLMiddleware::singleton()
|
||||||
$this->expectedRedirect = null;
|
|
||||||
|
|
||||||
// Ensure global state doesn't affect this test
|
|
||||||
$middleware
|
|
||||||
->setForceSSLDomain(null)
|
->setForceSSLDomain(null)
|
||||||
->setForceSSLPatterns([]);
|
->setForceSSLPatterns([])
|
||||||
|
->setEnabledEnvs(true);
|
||||||
|
$this->expectedRedirect = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getExtraRoutes()
|
protected function getExtraRoutes()
|
||||||
|
Loading…
Reference in New Issue
Block a user