diff --git a/composer.json b/composer.json index 74c6c35..273a54a 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "nikic/fast-route": "^1.3", "psr/container": "^2.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.1|^2.0", + "psr/http-message": "^2.0", "psr/http-server-handler": "^1.0.1", "psr/http-server-middleware": "^1.0.1", "opis/closure": "^3.6.3", diff --git a/tests/DispatchIntegrationTest.php b/tests/DispatchIntegrationTest.php index 32cb738..4ceb209 100644 --- a/tests/DispatchIntegrationTest.php +++ b/tests/DispatchIntegrationTest.php @@ -164,10 +164,10 @@ public function testDispatchesExceptionRoute(): void public function testDispatchesExceptionWithJsonStrategyRoute(): void { - $request = $this->createMock(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $response = $this->createMock(ResponseInterface::class); - $uri = $this->createMock(UriInterface::class); - $body = $this->createMock(StreamInterface::class); + $uri = $this->createMock(UriInterface::class); + $body = $this->createMock(StreamInterface::class); $uri ->expects($this->exactly(2)) @@ -683,9 +683,9 @@ public function testRouterSetsGroupStrategyOnGroupUriMatchButNoRouteMatch(): voi public function testRouteStrategyOverridesGlobalStrategy(): void { - $request = $this->createMock(ServerRequestInterface::class); + $request = $this->createMock(ServerRequestInterface::class); $response = $this->createMock(ResponseInterface::class); - $uri = $this->createMock(UriInterface::class); + $uri = $this->createMock(UriInterface::class); $request ->expects($this->once()) @@ -705,6 +705,12 @@ public function testRouteStrategyOverridesGlobalStrategy(): void ->willReturn($this->createMock(StreamInterface::class)) ; + $response + ->expects($this->once()) + ->method('withHeader') + ->willReturnSelf() + ; + $uri ->expects($this->exactly(2)) ->method('getPath') @@ -752,6 +758,12 @@ public function testRouteStrategyOverridesGroupStrategy(): void ->willReturn($this->createMock(StreamInterface::class)) ; + $response + ->expects($this->once()) + ->method('withHeader') + ->willReturnSelf() + ; + $uri ->expects($this->exactly(2)) ->method('getPath')