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