From 5cb4b748802149db447c884389cdc01c32522f26 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:56:50 +0200 Subject: [PATCH] Changed psr-7 versions to 1.1 and 2.0 + added regression test (#1344) (#1345) (cherry picked from commit 06ffbffec83a3de94a7240ee34d41a280000a62f) Co-authored-by: Enrico Zimuel --- composer.json | 2 +- tests/Response/ElasticsearchTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 11fddcc9e..a08acb69a 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "php": "^7.4 || ^8.0", "elastic/transport": "^8.7", "psr/http-client": "^1.0", - "psr/http-message": "^1.0 || ^2.0", + "psr/http-message": "^1.1 || ^2.0", "psr/log": "^1|^2|^3", "guzzlehttp/guzzle": "^7.0" }, diff --git a/tests/Response/ElasticsearchTest.php b/tests/Response/ElasticsearchTest.php index 9b9cc6d96..735755038 100644 --- a/tests/Response/ElasticsearchTest.php +++ b/tests/Response/ElasticsearchTest.php @@ -200,4 +200,12 @@ public function testAccessAsObject() $this->assertEquals($array['foo'], $this->elasticsearch->foo); } + + public function testWithStatusForPsr7Version1And2Compatibility() + { + $this->elasticsearch->setResponse($this->response200); + + $this->elasticsearch = $this->elasticsearch->withStatus(400); + $this->assertEquals(400, $this->elasticsearch->getStatusCode()); + } } \ No newline at end of file