public function testShouldGetPropertiesPassedInConstructor()
 {
     $event = new ExtendedConsoleEvent($this->commandMock, $this->inputMock, $this->outputMock);
     $this->assertSame($this->commandMock, $event->getCommand());
     $this->assertSame($this->inputMock, $event->getInput());
     $this->assertSame($this->outputMock, $event->getOutput());
 }
Example #2
0
 /**
  * Get input option on command initialization
  *
  * @param ExtendedConsoleEvent $event
  */
 public function onCommandRunTestsInit(ExtendedConsoleEvent $event)
 {
     $input = $event->getInput();
     $output = $event->getOutput();
     // Use the value of --xdebug only if the option was passed.
     // Don't apply the default if the option was not passed at all.
     if ($input->getParameterOption('--xdebug') !== false) {
         $this->xdebugIdeKey = $input->getOption('xdebug');
     }
     if ($this->xdebugIdeKey) {
         if (!extension_loaded('xdebug')) {
             throw new \RuntimeException('Extension Xdebug is not loaded or installed');
         }
         if (!ini_get('xdebug.remote_enable')) {
             throw new \RuntimeException('The xdebug.remote_enable directive must be true to enable remote debugging');
         }
         if ($output->isDebug()) {
             $output->writeln(sprintf('Xdebug remote debugging initialized with IDE key: %s', $this->xdebugIdeKey));
         }
     }
 }
Example #3
0
 /**
  * @param Command $command
  * @param InputInterface $input
  * @param OutputInterface $output
  * @param ProcessBuilder $processBuilder
  * @param array $args Arguments passed to the process
  */
 public function __construct(Command $command, InputInterface $input, OutputInterface $output, ProcessBuilder $processBuilder, array $args)
 {
     parent::__construct($command, $input, $output);
     $this->processBuilder = $processBuilder;
     $this->args = $args;
 }