@@ -153,6 +153,7 @@ public function testInvokeUnauthorized()
153153
154154 $ request = $ this ->createMock (ServerRequestInterface::class);
155155 $ request ->expects ($ this ->once ())->method ('getAttribute ' )->with ('auth ' )->willReturn ('user ' );
156+ $ request ->expects ($ this ->once ())->method ('getProtocolVersion ' )->willReturn ('1.1 ' );
156157
157158 $ stream = $ this ->createMock (StreamInterface::class);
158159 $ stream ->expects ($ this ->once ())->method ('write ' )->with ('Access denied ' );
@@ -161,6 +162,7 @@ public function testInvokeUnauthorized()
161162 $ forbiddenResponse ->expects ($ this ->once ())->method ('getBody ' )->willReturn ($ stream );
162163
163164 $ response = $ this ->createMock (ResponseInterface::class);
165+ $ response ->expects ($ this ->once ())->method ('withProtocolVersion ' )->with ('1.1 ' )->willReturnSelf ();
164166 $ response ->expects ($ this ->once ())->method ('withStatus ' )->with (401 )->willReturn ($ forbiddenResponse );
165167
166168 $ next = $ this ->createCallbackMock ($ this ->never ());
@@ -179,6 +181,7 @@ public function testInvokeForbidden()
179181
180182 $ request = $ this ->createMock (ServerRequestInterface::class);
181183 $ request ->expects ($ this ->once ())->method ('getAttribute ' )->with ('auth ' )->willReturn ('user ' );
184+ $ request ->expects ($ this ->once ())->method ('getProtocolVersion ' )->willReturn ('1.1 ' );
182185
183186 $ stream = $ this ->createMock (StreamInterface::class);
184187 $ stream ->expects ($ this ->once ())->method ('write ' )->with ('Access denied ' );
@@ -187,6 +190,7 @@ public function testInvokeForbidden()
187190 $ forbiddenResponse ->expects ($ this ->once ())->method ('getBody ' )->willReturn ($ stream );
188191
189192 $ response = $ this ->createMock (ResponseInterface::class);
193+ $ response ->expects ($ this ->once ())->method ('withProtocolVersion ' )->with ('1.1 ' )->willReturnSelf ();
190194 $ response ->expects ($ this ->once ())->method ('withStatus ' )->with (403 )->willReturn ($ forbiddenResponse );
191195
192196 $ next = $ this ->createCallbackMock ($ this ->never ());
0 commit comments