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); }
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); }
public function testOptionEnabled() { $this->debugDispatcher->expects($this->never())->method('dispatchDebug'); $this->initLogger(array('enabled' => false))->addDebug('test'); }
protected function callDispatchDebug() { $this->dispatcher->dispatchDebug(array('class' => get_class($this), 'method' => __FUNCTION__, 'line' => __LINE__)); }