@@ -70,8 +70,8 @@ public function testRegister()
70
70
71
71
public function testErrorGetLast ()
72
72
{
73
- $ handler = ErrorHandler::register ();
74
73
$ logger = $ this ->getMockBuilder ('Psr\Log\LoggerInterface ' )->getMock ();
74
+ $ handler = ErrorHandler::register ();
75
75
$ handler ->setDefaultLogger ($ logger );
76
76
$ handler ->screamAt (E_ALL );
77
77
@@ -143,9 +143,8 @@ public function testConstruct()
143
143
public function testDefaultLogger ()
144
144
{
145
145
try {
146
- $ handler = ErrorHandler::register ();
147
-
148
146
$ logger = $ this ->getMockBuilder ('Psr\Log\LoggerInterface ' )->getMock ();
147
+ $ handler = ErrorHandler::register ();
149
148
150
149
$ handler ->setDefaultLogger ($ logger , E_NOTICE );
151
150
$ handler ->setDefaultLogger ($ logger , [E_USER_NOTICE => LogLevel::CRITICAL ]);
@@ -334,12 +333,11 @@ public function testHandleDeprecation()
334
333
public function testHandleException ()
335
334
{
336
335
try {
336
+ $ logger = $ this ->getMockBuilder ('Psr\Log\LoggerInterface ' )->getMock ();
337
337
$ handler = ErrorHandler::register ();
338
338
339
339
$ exception = new \Exception ('foo ' );
340
340
341
- $ logger = $ this ->getMockBuilder ('Psr\Log\LoggerInterface ' )->getMock ();
342
-
343
341
$ logArgCheck = function ($ level , $ message , $ context ) {
344
342
$ this ->assertSame ('Uncaught Exception: foo ' , $ message );
345
343
$ this ->assertArrayHasKey ('exception ' , $ context );
@@ -483,6 +481,7 @@ public function testSettingLoggerWhenExceptionIsBuffered()
483
481
public function testHandleFatalError ()
484
482
{
485
483
try {
484
+ $ logger = $ this ->getMockBuilder ('Psr\Log\LoggerInterface ' )->getMock ();
486
485
$ handler = ErrorHandler::register ();
487
486
488
487
$ error = [
@@ -492,8 +491,6 @@ public function testHandleFatalError()
492
491
'line ' => 123 ,
493
492
];
494
493
495
- $ logger = $ this ->getMockBuilder ('Psr\Log\LoggerInterface ' )->getMock ();
496
-
497
494
$ logArgCheck = function ($ level , $ message , $ context ) {
498
495
$ this ->assertEquals ('Fatal Parse Error: foo ' , $ message );
499
496
$ this ->assertArrayHasKey ('exception ' , $ context );
0 commit comments