A special logger for debugging purposes. Provides debugging logging functions for RedBeanPHP.
Author: Gabor de Mooij and the RedBeanPHP Community
Inheritance: extends RedBeanPHP\Logger\RDefault, implements RedBeanPHP\Logger
Ejemplo n.º 1
0
 /**
  * Performs a test.
  * Given a query, a set of bindings and an expected outcome,
  * this method tests the result of the debugger.
  *
  * @param string $query
  * @param mixed  $bindings
  * @param string $expected
  *
  * @return void
  */
 private function testDebug($query, $bindings = NULL, $expected)
 {
     $debugger = new Debugger();
     $debugger->setMode(1);
     $debugger->setParamStringLength(20);
     if (!is_null($bindings)) {
         $debugger->log($query, $bindings);
     } else {
         $debugger->log($query);
     }
     $logs = $debugger->getLogs();
     $log = reset($logs);
     asrt($log, $expected);
     $debugger->clear();
 }