/** * test handleFatalError generating log. * * @return void */ public function testHandleFatalErrorLog() { $this->_logger->expects($this->at(0))->method('write')->with('error', $this->logicalAnd($this->stringContains(__FILE__ . ', line ' . (__LINE__ + 10)), $this->stringContains('Fatal Error (1)'), $this->stringContains('Something wrong'))); $this->_logger->expects($this->at(1))->method('write')->with('error', $this->stringContains('[Cake\\Error\\FatalErrorException] Something wrong')); $errorHandler = new ErrorHandler(['log' => true]); ob_start(); $errorHandler->handleFatalError(E_ERROR, 'Something wrong', __FILE__, __LINE__); ob_clean(); }
/** * Encount fatal error handler * * @access public * @author sakuragawa */ public function handleFatalError($code, $description, $file, $line) { $this->execute($code, 'FatalError', $description, $file, $line); return parent::handleFatalError($code, $description, $file, $line); }