/** * @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); }
/** * @param PHPUnitConfig $config * @param string $uniqueId * @return string */ public function getOptions(PHPUnitConfig $config, $uniqueId) { return '-c ' . $config->getFileFullPath() . ' --log-json ' . $this->filenameFactory->getFilenameForLog($uniqueId) . $this->createOptionsString($config); }