summaryrefslogtreecommitdiffstats
path: root/tests/Auth/MiddlewareTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Auth/MiddlewareTest.php')
-rw-r--r--tests/Auth/MiddlewareTest.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/Auth/MiddlewareTest.php b/tests/Auth/MiddlewareTest.php
index bba5357..84da021 100644
--- a/tests/Auth/MiddlewareTest.php
+++ b/tests/Auth/MiddlewareTest.php
@@ -153,6 +153,7 @@ class MiddlewareTest extends TestCase
$request = $this->createMock(ServerRequestInterface::class);
$request->expects($this->once())->method('getAttribute')->with('auth')->willReturn('user');
+ $request->expects($this->once())->method('getProtocolVersion')->willReturn('1.1');
$stream = $this->createMock(StreamInterface::class);
$stream->expects($this->once())->method('write')->with('Access denied');
@@ -161,6 +162,7 @@ class MiddlewareTest extends TestCase
$forbiddenResponse->expects($this->once())->method('getBody')->willReturn($stream);
$response = $this->createMock(ResponseInterface::class);
+ $response->expects($this->once())->method('withProtocolVersion')->with('1.1')->willReturnSelf();
$response->expects($this->once())->method('withStatus')->with(401)->willReturn($forbiddenResponse);
$next = $this->createCallbackMock($this->never());
@@ -179,6 +181,7 @@ class MiddlewareTest extends TestCase
$request = $this->createMock(ServerRequestInterface::class);
$request->expects($this->once())->method('getAttribute')->with('auth')->willReturn('user');
+ $request->expects($this->once())->method('getProtocolVersion')->willReturn('1.1');
$stream = $this->createMock(StreamInterface::class);
$stream->expects($this->once())->method('write')->with('Access denied');
@@ -187,6 +190,7 @@ class MiddlewareTest extends TestCase
$forbiddenResponse->expects($this->once())->method('getBody')->willReturn($stream);
$response = $this->createMock(ResponseInterface::class);
+ $response->expects($this->once())->method('withProtocolVersion')->with('1.1')->willReturnSelf();
$response->expects($this->once())->method('withStatus')->with(403)->willReturn($forbiddenResponse);
$next = $this->createCallbackMock($this->never());