summaryrefslogtreecommitdiffstats
path: root/tests/ErrorHandler/MiddlewareTest.php
diff options
context:
space:
mode:
authorArnold Daniels <arnold@jasny.net>2017-01-03 21:32:32 +0100
committerArnold Daniels <arnold@jasny.net>2017-01-03 21:32:32 +0100
commitc96f4e15becf76c91c46d050cbf90c5a56e4e169 (patch)
tree76b598d5639fc2fb58d0a5ad197bfc682755149e /tests/ErrorHandler/MiddlewareTest.php
parent02256d2fae90dfef4c9ac055afedb9883ae465c8 (diff)
downloaderror-handler-c96f4e15becf76c91c46d050cbf90c5a56e4e169.zip
error-handler-c96f4e15becf76c91c46d050cbf90c5a56e4e169.tar.gz
error-handler-c96f4e15becf76c91c46d050cbf90c5a56e4e169.tar.bz2
Set protocol version in error response
Diffstat (limited to 'tests/ErrorHandler/MiddlewareTest.php')
-rw-r--r--tests/ErrorHandler/MiddlewareTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ErrorHandler/MiddlewareTest.php b/tests/ErrorHandler/MiddlewareTest.php
index 891ed73..ef2767c 100644
--- a/tests/ErrorHandler/MiddlewareTest.php
+++ b/tests/ErrorHandler/MiddlewareTest.php
@@ -89,6 +89,10 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$exception = $this->createMock(\Exception::class);
$stream->expects($this->once())->method('write')->with('Unexpected error');
+
+ $request->expects($this->once())->method('getProtocolVersion')->willReturn('1.1');
+
+ $response->expects($this->once())->method('withProtocolVersion')->with('1.1')->willReturnSelf();
$response->expects($this->once())->method('withStatus')->with(500)->willReturn($errorResponse);
$errorResponse->expects($this->once())->method('getBody')->willReturn($stream);
@@ -123,6 +127,10 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$stream = $this->createMock(StreamInterface::class);
$stream->expects($this->once())->method('write')->with('Unexpected error');
+
+ $request->expects($this->once())->method('getProtocolVersion')->willReturn('1.1');
+
+ $response->expects($this->once())->method('withProtocolVersion')->with('1.1')->willReturnSelf();
$response->expects($this->once())->method('withStatus')->with(500)->willReturn($errorResponse);
$errorResponse->expects($this->once())->method('getBody')->willReturn($stream);
@@ -151,6 +159,7 @@ class MiddlewareTest extends \PHPUnit_Framework_TestCase
$response = $this->createMock(ResponseInterface::class);
$stream = $this->createMock(StreamInterface::class);
+ $response->method('withProtocolVersion')->willReturnSelf();
$response->method('withStatus')->willReturnSelf();
$response->method('getBody')->willReturn($stream);