Skip to content

Commit

Permalink
Merge pull request #5 from oehlschl/master
Browse files Browse the repository at this point in the history
suffix test suites with duplicate names
  • Loading branch information
andreaskweber committed Oct 6, 2015
2 parents ffcc921 + 1daabb9 commit c4b222f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Console/Command.php
Expand Up @@ -188,7 +188,17 @@ private function mergeFiles($directory, Finder $finder)

$inXml = $this->loadFile($file->getRealpath());
foreach ($inXml->query('//testsuites/testsuite') as $inElement) {

$inName = $inElement->getAttribute('name');
$outName = $inName;
$suffix = 2;
while ($outTestSuite->query('//testsuite[@name="' . $outName . '"]')->length !== 0) {
$outName = $inName . '_' . $suffix;
$suffix++;
}

$outElement = $outXml->importNode($inElement, true);
$outElement->setAttribute('name', $outName);
$outTestSuite->appendChild($outElement);

$tests += $inElement->getAttribute('tests');
Expand Down

0 comments on commit c4b222f

Please sign in to comment.