Skip to content

Commit d822bfb

Browse files
committed
Merge pull request #15 from gruenspar/avoid-changing-global-arguments
Do not run handleConfiguration() on $arguments
2 parents eeacf56 + 44880a0 commit d822bfb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/PHPUnitRandomizer/TestRunner.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class TestRunner extends \PHPUnit_TextUI_TestRunner
55
{
6-
/**
6+
/**
77
* Uses a random test suite to randomize the given test suite, and in case that no printer
88
* has been selected, uses printer that shows the random seed used to randomize.
99
*
@@ -12,12 +12,14 @@ class TestRunner extends \PHPUnit_TextUI_TestRunner
1212
*/
1313
public function doRun(\PHPUnit_Framework_Test $suite, array $arguments = array())
1414
{
15-
$this->handleConfiguration($arguments);
16-
if (isset($arguments['order']))
15+
$localArguments = $arguments;
16+
17+
$this->handleConfiguration($localArguments);
18+
if (isset($localArguments['order']))
1719
{
18-
$this->addPrinter($arguments);
20+
$this->addPrinter($localArguments);
1921
$randomizer = new Randomizer();
20-
$randomizer->randomizeTestSuite($suite, $arguments['seed']);
22+
$randomizer->randomizeTestSuite($suite, $localArguments['seed']);
2123
}
2224

2325
return parent::doRun($suite, $arguments);
@@ -42,4 +44,4 @@ private function addPrinter($arguments)
4244
$this->printer = $arguments['printer'];
4345
}
4446
}
45-
}
47+
}

0 commit comments

Comments
 (0)