コード例 #1
0
ファイル: LoggerTest.php プロジェクト: titounnes/CodeIgniter4
 public function testLogInterpolatesFileAndLine()
 {
     $config = new LoggerConfig();
     $logger = new Logger($config);
     $_ENV['foo'] = 'bar';
     // For whatever reason, this will often be the class/function instead of file and line.
     $expected = 'DEBUG - ' . date('Y-m-d') . ' --> Test message CodeIgniter\\Log\\LoggerTest testLogInterpolatesFileAndLine';
     $logger->log('debug', 'Test message {file} {line}');
     $logs = TestHandler::getLogs();
     $this->assertEquals(1, count($logs));
     $this->assertEquals($expected, $logs[0]);
 }