From 1d6d601050aef6a1ff2def631f34564f3448c771 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Fri, 8 Jun 2018 14:00:59 +0100 Subject: [PATCH] Use chaining syntax for setting up middleware --- tests/php/Control/DirectorTest.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/php/Control/DirectorTest.php b/tests/php/Control/DirectorTest.php index 5e34f2cdd..590dfc067 100644 --- a/tests/php/Control/DirectorTest.php +++ b/tests/php/Control/DirectorTest.php @@ -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()