Exemplo n.º 1
0
 public function testIsRedirectWhen3xxResponseCodeSet()
 {
     $this->_response->setHttpResponseCode(301);
     $this->assertTrue($this->_response->isRedirect());
 }
Exemplo n.º 2
0
 public function testIsNotRedirectWithSufficientlyLarge3xxResponseCodeSet()
 {
     $this->_response->setHttpResponseCode(309);
     $this->assertFalse($this->_response->isRedirect());
 }
 /**
  * return a string that is a key to the handler config for the class of status codes.
  * @param  Zend_Http_Response $response
  * @return string
  */
 protected function _getHandlerKey(Zend_Http_Response $response = null)
 {
     if ($response) {
         $code = $response->getStatus();
         if ($response->isSuccessful() || $response->isRedirect()) {
             return 'success';
         } elseif ($code < 500 && $code >= 400) {
             return 'client_error';
         } elseif ($code >= 500) {
             return 'server_error';
         }
         // @codeCoverageIgnoreStart
     }
     // @codeCoverageIgnoreEnd
     return 'no_response';
 }