예제 #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());
 }
예제 #2
0
 /**
  * Constructs a GitEvent object.
  *
  * @param \GitWrapper\GitWrapper $wrapper
  *   The GitWrapper object that likely instantiated this class.
  * @param \Symfony\Component\Process\Process $process
  *   The Process object being run.
  * @param \GitWrapper\GitCommand $command
  *   The GitCommand object being executed.
  */
 public function __construct(GitWrapper $wrapper, Process $process, GitCommand $command, $type, $buffer)
 {
     parent::__construct($wrapper, $process, $command);
     $this->type = $type;
     $this->buffer = $buffer;
 }
예제 #3
0
 public function onPrepare(GitEvent $event)
 {
     $event->getCommand()->bypass();
 }
예제 #4
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);
     }
 }