コード例 #1
0
 public function testCallStaticDebug()
 {
     $this->debugDispatcher->expects($this->once())->method('dispatchDebug')->with($this->equalTo(123), $this->equalTo('db'));
     \PhpConsole\Helper::register($this->connector);
     /** @noinspection PhpUndefinedMethodInspection */
     \PhpConsole\Helper::db(123);
 }
コード例 #2
0
ファイル: Debug.php プロジェクト: putturaj/php-console
 public function testIgnoreCallsByClassNames()
 {
     $test = $this;
     $actualTraceCalls = count(debug_backtrace());
     $ignoreTraceClasses = array('PhpConsole\\Test', 'ReflectionMethod');
     $this->dispatcher->detectTraceAndSource = true;
     $this->connector->expects($this->once())->method('sendMessage')->with($this->callback(function (\PhpConsole\DebugMessage $message) use($test, $ignoreTraceClasses, $actualTraceCalls) {
         $test->assertEquals($actualTraceCalls - count($ignoreTraceClasses), count($message->trace));
         return true;
     }));
     $this->dispatcher->dispatchDebug(null, null, $ignoreTraceClasses);
 }
コード例 #3
0
 public function testOptionEnabled()
 {
     $this->debugDispatcher->expects($this->never())->method('dispatchDebug');
     $this->initLogger(array('enabled' => false))->addDebug('test');
 }
コード例 #4
0
ファイル: Debug.php プロジェクト: rafabrutaldrums/casamacario
 protected function callDispatchDebug()
 {
     $this->dispatcher->dispatchDebug(array('class' => get_class($this), 'method' => __FUNCTION__, 'line' => __LINE__));
 }