public function testErrorsAreLoggedAsExceptions() { $client = $this->getMock('Client', array('captureException', 'getIdent')); $client->expects($this->once())->method('captureException')->with($this->isInstanceOf('ErrorException')); $handler = new Raven_ErrorHandler($client); $handler->handleError(E_WARNING, 'message'); }
/** * Send errors to sentry server * @param CErrorEvent $event represents the parameter for the onError event. * @return boolean */ public function handleError($event) { if (!($sentry = $this->getClient())) { return false; } $this->_errorHandler->handleError($event->code, $event->message, $event->file, $event->line, $event->params); if ($lastError = $sentry->getLastError()) { Yii::log($lastError, CLogger::LEVEL_ERROR, $this->ravenLogCategory); } return true; }