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()); }
/** * @dataProvider headersWithInjectionVectors */ public function testDoesNotAllowCRLFInjectionWhenCallingWithAddedHeader($name, $value) { $this->setExpectedException('InvalidArgumentException'); $this->message->withAddedHeader($name, $value); }