diff options
Diffstat (limited to 'vendor/symfony/debug/Tests/ErrorHandlerTest.php')
| -rw-r--r-- | vendor/symfony/debug/Tests/ErrorHandlerTest.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/vendor/symfony/debug/Tests/ErrorHandlerTest.php b/vendor/symfony/debug/Tests/ErrorHandlerTest.php index f758d21e0e..9ceeb0f097 100644 --- a/vendor/symfony/debug/Tests/ErrorHandlerTest.php +++ b/vendor/symfony/debug/Tests/ErrorHandlerTest.php @@ -70,8 +70,8 @@ class ErrorHandlerTest extends TestCase public function testErrorGetLast() { - $handler = ErrorHandler::register(); $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $handler = ErrorHandler::register(); $handler->setDefaultLogger($logger); $handler->screamAt(E_ALL); @@ -143,9 +143,8 @@ class ErrorHandlerTest extends TestCase public function testDefaultLogger() { try { - $handler = ErrorHandler::register(); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); + $handler = ErrorHandler::register(); $handler->setDefaultLogger($logger, E_NOTICE); $handler->setDefaultLogger($logger, [E_USER_NOTICE => LogLevel::CRITICAL]); @@ -331,12 +330,11 @@ class ErrorHandlerTest extends TestCase public function testHandleException() { try { + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $handler = ErrorHandler::register(); $exception = new \Exception('foo'); - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); - $logArgCheck = function ($level, $message, $context) { $this->assertSame('Uncaught Exception: foo', $message); $this->assertArrayHasKey('exception', $context); @@ -442,6 +440,7 @@ class ErrorHandlerTest extends TestCase public function testHandleFatalError() { try { + $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); $handler = ErrorHandler::register(); $error = [ @@ -451,8 +450,6 @@ class ErrorHandlerTest extends TestCase 'line' => 123, ]; - $logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock(); - $logArgCheck = function ($level, $message, $context) { $this->assertEquals('Fatal Parse Error: foo', $message); $this->assertArrayHasKey('exception', $context); |
