Exemplo n.º 1
0
 public function testLogWrite()
 {
     $readConfig = PlainFileLogger::getInstance()->getConfig();
     $this->assertEquals($this->testConfig['logger']['path'], $readConfig['logger']['path']);
     $data = 'This is a logged text';
     PlainFileLogger::log('error', $data);
     $loggedText = file_get_contents($this->loggerFile);
     $this->assertRegExp("/{$data}\$/", $loggedText);
     unlink($this->loggerFile);
     // info level is not logged, so this text wont be in the logger file
     $data = 'This is a logged text';
     PlainFileLogger::log('info', $data);
     $this->assertFalse(file_exists($this->loggerFile));
 }
Exemplo n.º 2
0
 public function testConfigRead()
 {
     $config = PlainFileLogger::getInstance()->getConfig();
     $this->assertEquals($this->testConfig, $config);
 }