mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-30 09:50:26 +02:00
Avoid issues with ErrorHandler being used in test suite
This commit is contained in:
@@ -176,13 +176,16 @@ class PHPConsoleHandlerTest extends TestCase
|
||||
|
||||
public function testException()
|
||||
{
|
||||
$exception = new Exception();
|
||||
$e = new Exception();
|
||||
$this->errorDispatcher->expects($this->once())->method('dispatchException')->with(
|
||||
$this->equalTo($exception)
|
||||
$this->equalTo($e)
|
||||
);
|
||||
$handler = $this->initLogger();
|
||||
$handler->log(
|
||||
\Psr\Log\LogLevel::ERROR,
|
||||
sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()),
|
||||
array('exception' => $e)
|
||||
);
|
||||
$errorHandler = ErrorHandler::register($this->initLogger(), false, false);
|
||||
$errorHandler->registerExceptionHandler(null, false);
|
||||
$errorHandler->handleException($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user