Пример #1
0
 /**
  * Test that response has status 302 Redirect and optionally that the 
  * location header is set to a specific URL.
  * 
  * @param string $url
  */
 protected function assertResponseRedirect($url = null)
 {
     $this->assertResponseStatusCode(302, "Failed asserting response status is redirect");
     $this->assertTrue($this->response->isRedirect(), "Failed asserting response is redirect");
     if (null !== $url) {
         $location = $this->response->getHeaders()->get('location')->getFieldValue();
         $this->assertEquals($url, $location, "Failed asserting redirect location '{$location}' is '{$url}'");
     }
 }