1
0
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:
Daniel Hensby 2018-06-08 14:00:59 +01:00
parent 48304fd6f0
commit 1d6d601050
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9

View File

@ -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()