moved() 공개 메소드

Configures response as a '301 Moved Permanently' permanent redirect.
public moved ( string $location )
$location string
예제 #1
0
 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");
 }