diff --git a/composer.json b/composer.json index 7ac3191..6806ef4 100644 --- a/composer.json +++ b/composer.json @@ -25,14 +25,14 @@ "require": { "php": "^8.0", "ext-json": "*", - "league/openapi-psr7-validator": "^0.21", + "league/openapi-psr7-validator": "^0.22", "nyholm/psr7": "^1.3.1", "psr/cache": "^1.0 || ^2.0 || ^3.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/simple-cache": "^1.0 || ^2.0 || ^3.0", "symfony/cache": "^5.0.9 || ^6.0 || ^7.0", "symfony/http-foundation": "^5.0.9 || ^6.0 || ^7.0", - "symfony/psr-http-message-bridge": "^2.0.1 || ^7.0" + "symfony/psr-http-message-bridge": "^2.0 || ^6.0 || ^7.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.17", diff --git a/tests/TestCase.php b/tests/TestCase.php index 2aaece9..9ea7361 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -7,6 +7,7 @@ use Nyholm\Psr7\Factory\Psr17Factory; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; +use Psr\Http\Message\StreamInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -42,7 +43,10 @@ protected function psr7Response(?array $content = null): ResponseInterface return $response; } - $response->method('getBody')->willReturn(json_encode($content, JSON_THROW_ON_ERROR)); + $body = $this->createMock(StreamInterface::class); + $body->method('__toString')->willReturn(json_encode($content, JSON_THROW_ON_ERROR)); + + $response->method('getBody')->willReturn($body); $response->method('getStatusCode')->willReturn(Response::HTTP_OK); $response->method('getHeader')->willReturn(['application/json']);