public function moved($location)
{
$this->_location = $location;
return $this->setStatusCode(301);
}
public function testRedirectPermanent() { $builder = new Http\ResponseBuilder(); $response = $builder->moved('http://example.org/test')->build(); $this->assertEquals($response->getStatus()->getCode(), 301); $this->assertFalse($response->hasBody()); $headers = $response->getHeaders()->toArray(); $this->assertEquals(count($headers), 2, 'should be 2 header: %s'); $this->assertEquals($headers[0], "Location: http://example.org/test\r\n"); $this->assertEquals($headers[1], "Content-Length: 0\r\n"); }