public function handleError($code, $description, $file = null, $line = null, $context = null) { try { $e = new ErrorException($description, 0, $code, $file, $line); self::sentryLog($e); return parent::handleError($code, $description, $file, $line, $context); } catch (Exception $e) { self::handleException($e); } }
/** * test that the console error handler can deal with CakeExceptions. * * @return void */ public function testHandleError() { $content = "<error>Notice Error:</error> This is a notice error in [/some/file, line 275]\n"; ConsoleErrorHandler::$stderr->expects($this->once())->method('write')->with($content); ConsoleErrorHandler::handleError(E_NOTICE, 'This is a notice error', '/some/file', 275); }