Example #1
0
 public function testFailHttpAuthentication()
 {
     $response = new Zend_Controller_Response_Http();
     $realm = uniqid();
     $response->headersSentThrowsException = false;
     $this->_object->failHttpAuthentication($response, $realm);
     $headers = $response->getHeaders();
     $this->assertArrayHasKey(0, $headers);
     $this->assertEquals('401 Unauthorized', $headers[0]['value']);
     $this->assertArrayHasKey(1, $headers);
     $this->assertContains('realm="' . $realm . '"', $headers[1]['value']);
     $this->assertContains('401', $response->getBody());
 }