Compare commits

...

2 Commits

Author SHA1 Message Date
Guy Sartorelli
b5bea0c343
Merge pull request #10287 from creative-commoners/pulls/4.10/director-tests
MNT Fix unit tests for kitchen-sink
2022-04-22 15:04:32 +12:00
Steve Boyd
656cba05e6 MNT Fix unit tests for kitchen-sink 2022-04-22 12:32:35 +12:00

View File

@ -38,8 +38,10 @@ class DirectorTest extends SapphireTest
// Ensure redirects enabled on all environments and global state doesn't affect the tests
CanonicalURLMiddleware::singleton()
->setForceSSL(null)
->setForceSSLDomain(null)
->setForceSSLPatterns([])
->setForceWWW(null)
->setEnabledEnvs(true);
$this->expectedRedirect = null;
}
@ -858,7 +860,10 @@ class DirectorTest extends SapphireTest
$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');
$this->assertEquals(404, $response->getStatusCode());