Exemplo n.º 1
0
 public function testResponseChangeHeaders()
 {
     $response = new Response('Body', 404);
     $this->assertEquals($response->getStatus()->getCode(), 404);
     $this->assertEquals($response->getBody(), 'Body');
     $response->addHeader('Auth', 'author');
     $this->assertEquals($response->getStatus()->getCode(), 404);
     $this->assertEquals($response->getHeaders(), array('Auth' => 'author'));
     $response->addHeader('Auth', 'author_change');
     $this->assertEquals($response->getHeaders(), array('Auth' => 'author_change'));
 }
Exemplo n.º 2
0
function send(Response $response)
{
    foreach ($response->getHeaders() as $header) {
        header($header, false);
    }
    echo $response->getContent();
}