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()); }
/** * 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; }
public function onPrepare(GitEvent $event) { $event->getCommand()->bypass(); }
/** * 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); } }