public function testConstructorCanAcceptAllMessageParts() { $body = new MemoryStream(); $status = 302; $headers = ['location' => ['http://example.com/']]; $response = new Response($body, $status, $headers); $this->assertSame($body, $response->getBody()); $this->assertEquals(302, $response->getStatusCode()); $this->assertEquals($headers, $response->getHeaders()); }
public function testHeadersInitialization() { $headers = ['X-Foo' => ['bar']]; $this->message = new Response(null, null, $headers); $this->assertSame($headers, $this->message->getHeaders()); }