예제 #1
0
파일: HttpTest.php 프로젝트: lortnus/zf1
 public function testGetExceptionByCode()
 {
     $this->assertFalse($this->_response->getExceptionByCode(200));
     $this->_response->setException(new Zend_Controller_Response_Exception('FooBar', 200));
     $exceptions = $this->_response->getExceptionByCode(200);
     $this->assertTrue(0 < count($exceptions));
     $this->assertEquals(200, $exceptions[0]->getCode());
 }
예제 #2
0
 public function testSendResponseWithExceptions()
 {
     $e = new Exception('Test exception rendering');
     $this->_response->setException($e);
     $this->_response->renderExceptions(true);
     ob_start();
     $this->_response->sendResponse();
     $string = ob_get_clean();
     $this->assertContains('Test exception rendering', $string);
 }