Skip to content

Commit

Permalink
Mark psr/http-message >=2.0 supported (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxr576 authored Oct 2, 2023
1 parent ba93b3a commit d8888b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions tests/Utility/ResponseToArrayHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d8888b8

Please sign in to comment.