Exemplo n.º 1
0
 /**
  * Handle console input
  *
  * @param InputInterface $input
  * @return Configuration
  */
 public static function handleInput(InputInterface $input)
 {
     $configOption = $input->getOption('configuration');
     $configFile = ConfigLocator::locate($configOption);
     $configuration = ConfigLoader::loadConfig($configFile);
     $phpunit = $configuration->getPHPUnitConfiguration();
     if (null !== $input->getOption('bootstrap')) {
         $phpunit['bootstrap'] = $input->getOption('bootstrap');
     }
     if (isset($phpunit['bootstrap'])) {
         FileLoader::loadFile($phpunit['bootstrap']);
     }
     return $configuration;
 }
Exemplo n.º 2
0
 /**
  * @covers OckCyp\CoversValidator\Loader\ConfigLoader::loadConfig
  */
 public function testLoadsConfig()
 {
     $xml = new \SimpleXMLElement('<?xml version="1.0" standalone="yes" ?><phpunit />');
     file_put_contents('temp-config.xml', $xml->asXML());
     $this->assertInstanceOf('PHPUnit_Util_Configuration', ConfigLoader::loadConfig('temp-config.xml'));
 }