From 63ee9e3e0a2da1adf2f106cf717b82f95c6e75c8 Mon Sep 17 00:00:00 2001 From: Andrea Giannantonio Date: Mon, 15 Jan 2024 15:22:41 +0100 Subject: [PATCH] feat: add support for http messages v2 --- composer.json | 2 +- tests/ClientAdapter/Psr18AdapterTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index da9beee..bec63fb 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "ext-json": "*", "psr/http-client": "^1.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "symfony/http-client-contracts": "^2.4 || ^3.0" }, "require-dev": { diff --git a/tests/ClientAdapter/Psr18AdapterTest.php b/tests/ClientAdapter/Psr18AdapterTest.php index 2c7aeab..7c30c5e 100644 --- a/tests/ClientAdapter/Psr18AdapterTest.php +++ b/tests/ClientAdapter/Psr18AdapterTest.php @@ -7,6 +7,7 @@ use ImmobiliareLabs\BrazeSDK\Exception\NotValidBaseURIException; use ImmobiliareLabs\BrazeSDK\Exception\TransportException; use ImmobiliareLabs\BrazeSDK\Region; +use Nyholm\Psr7\Stream; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Http\Client\ClientExceptionInterface; @@ -140,7 +141,7 @@ public function testResolveResponse(): void $httpResponseMock->expects($this->once()) ->method('getBody') - ->willReturn(''); + ->willReturn(Stream::create('')); $resolvedResponse = $this->psr18Adapter->resolveResponse($httpResponseMock);