Beispiel #1
0
 /**
  * Test isRedirect()
  *
  * @return void
  */
 public function testIsRedirect()
 {
     $headers = ['HTTP/1.1 200 OK', 'Content-Type: text/html'];
     $response = new Response($headers, 'ok');
     $this->assertFalse($response->isRedirect());
     $headers = ['HTTP/1.1 301 Moved Permanently', 'Location: /', 'Content-Type: text/html'];
     $response = new Response($headers, '');
     $this->assertTrue($response->isRedirect());
     $headers = ['HTTP/1.0 404 Not Found', 'Content-Type: text/html'];
     $response = new Response($headers, '');
     $this->assertFalse($response->isRedirect());
 }