Ejemplo n.º 1
0
 public function testEvent()
 {
     $process = new Process('');
     $command = GitCommand::getInstance();
     $event = new GitEvent($this->_wrapper, $process, $command);
     $this->assertEquals($this->_wrapper, $event->getWrapper());
     $this->assertEquals($process, $event->getProcess());
     $this->assertEquals($command, $event->getCommand());
 }
Ejemplo n.º 2
0
 /**
  * Adds a logg message using the level defined in the mappings.
  *
  * @param \GitWrapper\Event\GitEvent $event
  * @param string $message
  * @param array $context
  *
  * @throws \DomainException
  */
 public function log(GitEvent $event, $message, array $context = array())
 {
     $method = $this->getLogLevelMapping($event->getName());
     if ($method !== false) {
         $context += array('command' => $event->getProcess()->getCommandLine());
         $this->logger->{$method}($message, $context);
     }
 }