From 0c395e83b39615ed94efc4155c72d5f9d2ba4bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dezs=C5=91=20BICZ=C3=93?= Date: Wed, 20 Sep 2023 11:33:04 +0000 Subject: [PATCH] Mark psr/http-message >=2.0 supported --- composer.json | 2 +- tests/Utility/ResponseToArrayHelperTest.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index b5bc0550..4cf7aa0c 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": "^5.4", "symfony/property-access": "^6.2", "symfony/property-info": "^6.2", 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);