private function createOptionsString(PHPUnitConfig $config) { $optionString = ''; foreach ($config->getPhpunitOptions() as $option) { $optionString .= ' --' . $option->getName(); if ($option->hasValue()) { $optionString .= '=' . $option->getValue(); } } return $optionString; }
/** * @param InputInterface $input * @return PHPUnitConfig * @throws \InvalidArgumentException */ private function createConfig(InputInterface $input) { $config = new PHPUnitConfig($input->getOption('configuration')); foreach ($this->phpunitOptions as $option) { $cliOption = $input->getOption($option->getName()); if ($cliOption) { $option->setValue($cliOption); $config->addPhpunitOption($option); } } return $config; }
/** * @param PHPUnitConfig $configFile * @param string | null $testSuiteFilter * * @return array */ public function filterTestFiles(PHPUnitConfig $configFile, $testSuiteFilter = null) { $aggregatedFiles = array(); $this->relativePath = $configFile->getDirectory() . DIRECTORY_SEPARATOR; $document = $this->utilXml->loadFile($configFile->getFileFullPath(), false, true, true); $xpath = new \DOMXPath($document); /** @var \DOMNode $testSuiteNode */ foreach ($xpath->query('testsuites/testsuite') as $testSuiteNode) { if (is_null($testSuiteFilter) || $testSuiteFilter == $this->getDOMNodeAttribute($testSuiteNode, 'name')) { $this->addTestsFromTestSuite($testSuiteNode, $aggregatedFiles); } } return array_values($aggregatedFiles); }