From 93e578e555b6e40c1e26d85e4f32b87577f54def Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 20 Nov 2018 18:57:11 +0100 Subject: Added html content sniffer --- tests/Unit/Middleware/ErrorHandlerTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/Unit/Middleware/ErrorHandlerTest.php b/tests/Unit/Middleware/ErrorHandlerTest.php index cce752d1..6c37b651 100644 --- a/tests/Unit/Middleware/ErrorHandlerTest.php +++ b/tests/Unit/Middleware/ErrorHandlerTest.php @@ -143,4 +143,23 @@ class ErrorHandlerTest extends TestCase $return = $errorHandler->process($request, $returnResponseHandler); $this->assertEquals($psrResponse, $return); } + + /** + * @covers \Engelsystem\Middleware\ErrorHandler::process + */ + public function testProcessContentTypeSniffer() + { + /** @var ServerRequestInterface|MockObject $request */ + $request = $this->createMock(ServerRequestInterface::class); + /** @var TwigLoader|MockObject $twigLoader */ + $twigLoader = $this->createMock(TwigLoader::class); + $response = new Response('

Hi!

', 500); + $returnResponseHandler = new ReturnResponseMiddlewareHandler($response); + + /** @var ErrorHandler|MockObject $errorHandler */ + $errorHandler = new ErrorHandler($twigLoader); + + $return = $errorHandler->process($request, $returnResponseHandler); + $this->assertEquals($response, $return); + } } -- cgit v1.2.3-70-g09d2