public function test_create_recoverable_error_and_call_handler() { $converter = new ErrorConverter(); $handler = new ErrorHandler(true); $this->setExpectedException(ErrorException::class); $converter->createRecoverableErrorAndCallHandler($handler, ErrorType::ERROR, 'foo', 'bar', 'yolo'); }
/** * Enable regular error handling. */ public function enableRecoverableErrorHandling() { if ($this->isRecoverableErrorHandlingEnabled()) { return; } set_error_handler(function ($number, $string, $file, $line) { // remove error from error_get_last() @trigger_error(null); return $this->errorConverter->createRecoverableErrorAndCallHandler($this, $number, $string, $file, $line); }); $this->isRecoverableErrorHandlingEnabled = true; }