Exemplo n.º 1
0
 public function testChainedLogging()
 {
     $console1 = new Console();
     $console1->setUseStream(false);
     $console2 = new Console();
     $console2->setUseStream(false);
     $obj = new Router();
     $obj->addChannel(array(LogLevel::EMERGENCY, LogLevel::ERROR), $console1)->addChannel(LogLevel::ERROR, $console2);
     $this->expectOutputString("emergency:EMERGENCY log\n");
     $obj->log(LogLevel::EMERGENCY, 'EMERGENCY log');
     $this->expectOutputString("emergency:EMERGENCY log\nerror:ERROR log\nerror:ERROR log\n");
     $obj->log(LogLevel::ERROR, 'ERROR log');
 }
Exemplo n.º 2
0
 /**
  * Does the Object output correctly to the console
  */
 public function testConsoleOutput()
 {
     $obj = new Console();
     $this->expectOutputString("hello, this is a test log\n");
     $obj->write("hello, this is a test log");
 }