log() public méthode

Log something using the configured logger callable (if available).
public log ( array $log )
$log array
 public function testLog()
 {
     $conn = new Connection();
     $called = false;
     $conn->getConfiguration()->setLoggerCallable(function ($msg) use(&$called) {
         $called = $msg;
     });
     $conn->log(array('test'));
     $this->assertEquals(array('test'), $called);
 }
Exemple #2
0
 public function testLogShouldDoNothingWithoutLoggerCallable()
 {
     $conn = new Connection();
     $conn->log(array('test'));
     $this->assertNull($conn->getConfiguration()->getLoggerCallable());
 }