summaryrefslogtreecommitdiff
path: root/tests/Unit
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-20 18:57:11 +0100
committermsquare <msquare@notrademark.de>2019-06-12 10:20:08 +0200
commit93e578e555b6e40c1e26d85e4f32b87577f54def (patch)
tree0a14f4a1910d646c3b21cebf4494d3f0bf75486f /tests/Unit
parent1f433694d25fc6d9e9d82ae725b618531b313aac (diff)
Added html content sniffer
Diffstat (limited to 'tests/Unit')
-rw-r--r--tests/Unit/Middleware/ErrorHandlerTest.php19
1 files changed, 19 insertions, 0 deletions
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('<!DOCTYPE html><html><body><h1>Hi!</h1></body></html>', 500);
+ $returnResponseHandler = new ReturnResponseMiddlewareHandler($response);
+
+ /** @var ErrorHandler|MockObject $errorHandler */
+ $errorHandler = new ErrorHandler($twigLoader);
+
+ $return = $errorHandler->process($request, $returnResponseHandler);
+ $this->assertEquals($response, $return);
+ }
}