Exemplo n.º 1
0
 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());
 }
Exemplo n.º 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));
         }
     }
 }