File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 1717use CodeIgniter \Test \Mock \MockLogger as LoggerConfig ;
1818use Exception ;
1919use Tests \Support \Log \Handlers \TestHandler ;
20+ use TypeError ;
2021
2122/**
2223 * @internal
@@ -48,14 +49,14 @@ public function testLogThrowsExceptionOnInvalidLevel(): void
4849 $ logger ->log ('foo ' , '' );
4950 }
5051
51- public function testLogReturnsFalseWhenLogNotHandled (): void
52+ public function testLogAlwaysReturnsVoid (): void
5253 {
5354 $ config = new LoggerConfig ();
5455 $ config ->threshold = 3 ;
5556
5657 $ logger = new Logger ($ config );
5758
58- $ this ->assertFalse ($ logger ->log ('debug ' , '' ));
59+ $ this ->assertNull ($ logger ->log ('debug ' , '' ));
5960 }
6061
6162 public function testLogActuallyLogs (): void
@@ -361,16 +362,12 @@ public function testLogLevels(): void
361362
362363 public function testNonStringMessage (): void
363364 {
365+ $ this ->expectException (TypeError::class);
366+
364367 $ config = new LoggerConfig ();
365368 $ logger = new Logger ($ config );
366369
367- $ expected = '[Tests\Support\Log\Handlers\TestHandler] ' ;
368370 $ logger ->log (5 , $ config );
369-
370- $ logs = TestHandler::getLogs ();
371-
372- $ this ->assertCount (1 , $ logs );
373- $ this ->assertStringContainsString ($ expected , $ logs [0 ]);
374371 }
375372
376373 public function testDetermineFileNoStackTrace (): void
You can’t perform that action at this time.
0 commit comments