'application/json'], '{"message":"Server Message"}'); $exception = HttpClientException::badRequest($response); $this->assertStringEndsWith('Server Message', $exception->getMessage()); $response = new Response(400, ['Content-Type' => 'application/json'], '{"Foo":"Server Message"}'); $exception = HttpClientException::badRequest($response); $this->assertStringEndsWith('{"Foo":"Server Message"}', $exception->getMessage()); } public function testBadRequestGetMessage() { $response = new Response(400, ['Content-Type' => 'text/html'], 'Server HTML'); $exception = HttpClientException::badRequest($response); $this->assertStringEndsWith('Server HTML', $exception->getMessage()); } }