public function testSetErrorHandler() { $this->plugin->setErrorHandler(array('module' => 'myfoo', 'controller' => 'bar', 'action' => 'boobaz')); $this->assertEquals('myfoo', $this->plugin->getErrorHandlerModule()); $this->assertEquals('bar', $this->plugin->getErrorHandlerController()); $this->assertEquals('boobaz', $this->plugin->getErrorHandlerAction()); }
/** * setErrorHandler() - setup the error handling options * * @param array $options * @return Zym_Controller_Plugin_ErrorHandler */ public function setErrorHandler(array $options = array()) { if (isset($options['moduleErrorHandling'])) { $this->setModuleErrorHandling($options['moduleErrorHandling']); } if (isset($options['moduleErrorHandlerMap'])) { $this->setModuleErrorHandlerMap($options['moduleErrorHandlerMap']); } return parent::setErrorHandler($options); }
/** * init plugins * @return void */ protected function _initPlugins() { # only embed the debugging plugin if application status is development or testing if ($this->applicationStatus == "development") { # embed the ZFDebug Plugin/console $debug = new ZFDebug_Controller_Plugin_Debug(array('jquery_path' => '', 'plugins' => array('Variables', 'File' => array('basePath' => APPLICATION_PATH), 'Memory', 'Time', 'Html', 'Exception'))); $this->frontController->registerPlugin($debug); } # init error handler $this->frontController->throwExceptions(false); $errorhandler = new Zend_Controller_Plugin_ErrorHandler(); $errorhandler->setErrorHandler(array('module' => 'cms', 'controller' => 'error', 'action' => 'error')); $this->frontController->registerPlugin($errorhandler); # gadget plugin $gadgetPlugin = new FansubCMS_Controller_Plugin_Gadget(); $this->frontController->registerPlugin($gadgetPlugin); # not-logged-in-so-go-to-login plugin $aclPlugin = new FansubCMS_Controller_Plugin_Acl(Zend_Auth::getInstance()->setStorage(new FansubCMS_Auth_Storage_DoctrineSession())); $this->frontController->registerPlugin($aclPlugin); # check if install or update is needed $installPlugin = new FansubCMS_Controller_Plugin_InstallCheck(); $this->frontController->registerPlugin($installPlugin); # the navigation plugin $navPlugin = new FansubCMS_Controller_Plugin_Navigation(); $this->frontController->registerPlugin($navPlugin); }