1
0
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:
Jordi Boggiano
2015-07-12 11:54:49 +01:00
parent 6d9062594c
commit 2dc16dd802

View File

@@ -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);
}
/**