コード例 #1
0
 public function testFlushTo()
 {
     $mockLogger = $this->mock(tubepress_api_log_LoggerInterface::_);
     $mockLogger->shouldReceive('debug')->once()->with(Mockery::on(function ($m) {
         $utils = new tubepress_util_impl_StringUtils();
         return $utils->endsWith($m, 'something');
     }), array());
     $this->_sut->debug('something');
     $this->_sut->flushTo($mockLogger);
     $this->assertTrue(true);
 }
コード例 #2
0
 private function _07_recordFinishTime()
 {
     if (!$this->_bootLogger->isEnabled()) {
         return;
     }
     $now = microtime(true);
     $this->_logDebug(sprintf('Boot completed in <code>%f</code> milliseconds. Actual performance will be better when debugging is not active.', ($now - $this->_startTime) * 1000.0));
     /**
      * @var $realLogger tubepress_api_log_LoggerInterface
      */
     $realLogger = self::$_SERVICE_CONTAINER->get(tubepress_api_log_LoggerInterface::_);
     /**
      * Flush the boot logger to the real logger.
      */
     $this->_bootLogger->flushTo($realLogger);
     $this->_bootLogger->onBootComplete();
     /**
      * Activate the real logger.
      */
     $realLogger->onBootComplete();
 }