guzzleResponse = new GuzzleResponse(418); } public function testGetBody(): void { $response = new Response($this->guzzleResponse->withBody(Utils::streamFor('MyResponse'))); $this->assertSame('MyResponse', $response->getBody()); } public function testGetStatusCode(): void { $response = new Response($this->guzzleResponse); $this->assertSame(418, $response->getStatusCode()); } public function testGetHeader(): void { $response = new Response($this->guzzleResponse->withHeader('bar', 'foo')); $this->assertSame('foo', $response->getHeader('bar')); } public function testGetHeaders(): void { $response = new Response($this->guzzleResponse ->withHeader('bar', 'foo') ->withHeader('x-awesome', 'yes') ); $expected = [ 'bar' => [ 0 => 'foo', ], 'x-awesome' => [ 0 => 'yes', ], ]; $this->assertSame($expected, $response->getHeaders()); $this->assertSame('yes', $response->getHeader('x-awesome')); } }