diff --git a/composer.json b/composer.json index c2b1b228..0b0c819a 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "php-http/message": "^1.13", "php-http/message-factory": "^1.0", "phpdocumentor/reflection-docblock": "^5.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "symfony/options-resolver": "^6.3", "symfony/property-access": "^6.3", "symfony/property-info": "^6.3", diff --git a/tests/Utility/ResponseToArrayHelperTest.php b/tests/Utility/ResponseToArrayHelperTest.php index 9cdcbe28..6f653d5f 100644 --- a/tests/Utility/ResponseToArrayHelperTest.php +++ b/tests/Utility/ResponseToArrayHelperTest.php @@ -19,6 +19,7 @@ namespace Apigee\Edge\Tests\Utility; use Apigee\Edge\Tests\Test\Utility\ResponseToArrayHelper; +use GuzzleHttp\Psr7\Utils; use PHPUnit\Framework\TestCase; use Psr\Http\Message\ResponseInterface; @@ -50,13 +51,13 @@ public function testExpandCompatibility($edgeResponse, $hybridResponse): void /** @var \Psr\Http\Message\ResponseInterface $response1 */ $response1 = $this->getMockBuilder(ResponseInterface::class)->getMock(); $response1->method('getHeaderLine')->willReturn('application/json'); - $response1->method('getBody')->willReturn($edgeResponse); + $response1->method('getBody')->willReturn(Utils::streamFor($edgeResponse)); $decodedEdgeStyle = $this->responseToArrayHelper->convertResponseToArray($response1, false); /** @var \Psr\Http\Message\ResponseInterface $response2 */ $response2 = $this->getMockBuilder(ResponseInterface::class)->getMock(); $response2->method('getHeaderLine')->willReturn('application/json'); - $response2->method('getBody')->willReturn($hybridResponse); + $response2->method('getBody')->willReturn(Utils::streamFor($hybridResponse)); $decodedWithCompatibility = $this->responseToArrayHelper->convertResponseToArray($response2, true); $this->assertEquals($decodedEdgeStyle, $decodedWithCompatibility);