Skip to content

Commit

Permalink
Merge pull request #10287 from creative-commoners/pulls/4.10/director…
Browse files Browse the repository at this point in the history
…-tests

MNT Fix unit tests for kitchen-sink
  • Loading branch information
GuySartorelli authored Apr 22, 2022
2 parents 77e8787 + 656cba0 commit b5bea0c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/php/Control/DirectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ protected function setUp(): void

// 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;
}
Expand Down Expand Up @@ -858,7 +860,10 @@ public function testRequestFilterInDirectorTest()

$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());

Expand Down

0 comments on commit b5bea0c

Please sign in to comment.