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