MNT Fix unit tests for kitchen-sink

This commit is contained in:
Steve Boyd 2022-04-22 12:32:35 +12:00
parent 77e87875b3
commit 656cba05e6

View File

@ -38,8 +38,10 @@ class DirectorTest extends SapphireTest
// Ensure redirects enabled on all environments and global state doesn't affect the tests // Ensure redirects enabled on all environments and global state doesn't affect the tests
CanonicalURLMiddleware::singleton() CanonicalURLMiddleware::singleton()
->setForceSSL(null)
->setForceSSLDomain(null) ->setForceSSLDomain(null)
->setForceSSLPatterns([]) ->setForceSSLPatterns([])
->setForceWWW(null)
->setEnabledEnvs(true); ->setEnabledEnvs(true);
$this->expectedRedirect = null; $this->expectedRedirect = null;
} }
@ -858,7 +860,10 @@ class DirectorTest extends SapphireTest
$processor = new RequestProcessor([$filter]); $processor = new RequestProcessor([$filter]);
Injector::inst()->registerService($processor, RequestProcessor::class); $middlewares = Director::singleton()->getMiddlewares();
$middlewares['RequestProcessorMiddleware'] = $processor;
Director::singleton()->setMiddlewares($middlewares);
$response = Director::test('some-dummy-url'); $response = Director::test('some-dummy-url');
$this->assertEquals(404, $response->getStatusCode()); $this->assertEquals(404, $response->getStatusCode());