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();
|
||||
Director::config()->set('alternate_base_url', 'http://www.mysite.com:9090/');
|
||||
|
||||
// Ensure redirects enabled on all environments
|
||||
$middleware = CanonicalURLMiddleware::singleton()->setEnabledEnvs(true);
|
||||
$this->expectedRedirect = null;
|
||||
|
||||
// Ensure global state doesn't affect this test
|
||||
$middleware
|
||||
// Ensure redirects enabled on all environments and global state doesn't affect the tests
|
||||
CanonicalURLMiddleware::singleton()
|
||||
->setForceSSLDomain(null)
|
||||
->setForceSSLPatterns([]);
|
||||
->setForceSSLPatterns([])
|
||||
->setEnabledEnvs(true);
|
||||
$this->expectedRedirect = null;
|
||||
}
|
||||
|
||||
protected function getExtraRoutes()
|
||||
|
Loading…
Reference in New Issue
Block a user