示例#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);
 }