Example #1
0
 public function testGetReasonPhraseReturnsTheReasonPhrase()
 {
     $response = new Response();
     $this->assertEquals($response->getReasonPhrase(), null);
     $response->addHeader('1.0 200 OK');
     $this->assertEquals($response->getReasonPhrase(), 'OK');
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function encodeResponse(Response $response) : string
 {
     return sprintf("HTTP/%s %d %s\r\n%s\r\n", $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase(), $this->encodeHeaders($response->getHeaders()));
 }
Example #3
0
 public function testConstructBodyStatusPhrase()
 {
     $response = new Response(["test" => "value"], "php://memory", 550);
     $this->assertEquals(550, $response->getStatusCode());
     $this->assertEmpty($response->getReasonPhrase());
 }