当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Exception::getMessage方法代码示例

本文整理汇总了PHP中Zend_Exception::getMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Exception::getMessage方法的具体用法?PHP Zend_Exception::getMessage怎么用?PHP Zend_Exception::getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Exception的用法示例。


在下文中一共展示了Zend_Exception::getMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkModifyException

 public function checkModifyException(Zend_Exception $exception)
 {
     if (preg_match('/Duplicate entry.*for key (2|\'nickname\')/i', $exception->getMessage())) {
         $this->_setError('nicknameExists');
         return false;
     }
     if (preg_match('/Duplicate entry.*for key (3|\'name\')/i', $exception->getMessage())) {
         $this->_setError('nameExists');
         return false;
     }
     return true;
 }
开发者ID:sitengine,项目名称:sitengine,代码行数:12,代码来源:Table.php

示例2: testExceptions

 public function testExceptions()
 {
     // Ohne Mail
     $exception = new Kwf_Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertTrue($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Mit Mail
     Zend_Registry::get('config')->debug->error->log = true;
     Kwf_Config::deleteValueCache('debug.error.log');
     $exception = new Kwf_Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertFalse($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Nicht-Kwf_Exception mit Mail
     Zend_Registry::get('config')->debug->error->log = true;
     Kwf_Config::deleteValueCache('debug.error.log');
     $e = new Zend_Exception();
     $exception = new Kwf_Exception_Other($e);
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $e->getMessage());
     $this->assertFalse($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     Zend_Registry::get('config')->debug->error->log = false;
     Kwf_Config::deleteValueCache('debug.error.log');
     // Kwf_Exception_NoLog mit Debug
     Zend_Registry::get('config')->debug->error->log = true;
     Kwf_Config::deleteValueCache('debug.error.log');
     $exception = new Kwf_Exception_NoLog();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertFalse($view->debug);
     Zend_Registry::get('config')->debug->error->log = false;
     Kwf_Config::deleteValueCache('debug.error.log');
     $this->assertEquals($view->template, 'error.tpl');
     // Kwf_Exception_NoLog ohne Debug
     $exception = new Kwf_Exception_NoLog();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertTrue($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Kwf_Exception_NotFound
     $exception = new Kwf_Exception_NotFound();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error404.tpl');
     // Nicht-Kwf_Exception
     $exception = new Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error.tpl');
     // ClientException
     $exception = new Kwf_ClientException();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error-client.tpl');
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:59,代码来源:ExceptionTest.php

示例3: testExceptions

 public function testExceptions()
 {
     // Ohne Mail
     $exception = new Kwf_Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertTrue($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Mit Mail
     Kwf_Exception_Abstract::$logErrors = true;
     $exception = new Kwf_Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertFalse($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Nicht-Kwf_Exception mit Mail
     Kwf_Exception_Abstract::$logErrors = true;
     $e = new Zend_Exception();
     $exception = new Kwf_Exception_Other($e);
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $e->getMessage());
     $this->assertFalse($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     Kwf_Exception_Abstract::$logErrors = null;
     // Kwf_Exception_NoLog mit Debug
     Kwf_Exception_Abstract::$logErrors = true;
     $exception = new Kwf_Exception_NoLog();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertFalse($view->debug);
     Kwf_Exception_Abstract::$logErrors = null;
     $this->assertEquals($view->template, 'error.tpl');
     // Kwf_Exception_NoLog ohne Debug
     $exception = new Kwf_Exception_NoLog();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertTrue($view->debug);
     $this->assertEquals($view->template, 'error.tpl');
     // Kwf_Exception_NotFound
     $exception = new Kwf_Exception_NotFound();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error404.tpl');
     // Nicht-Kwf_Exception
     $exception = new Exception();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error.tpl');
     // ClientException
     $exception = new Kwf_ClientException();
     $view = $this->_processException($exception);
     $this->assertEquals($view->message, $exception->getMessage());
     $this->assertEquals($view->template, 'error-client.tpl');
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:54,代码来源:ExceptionTest.php

示例4: testMessage

 public function testMessage()
 {
     $e = new Zend_Exception('msg');
     $this->assertEquals('msg', $e->getMessage());
 }
开发者ID:sasezaki,项目名称:mirror-zf1-tests,代码行数:5,代码来源:ExceptionTest.php


注:本文中的Zend_Exception::getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。