Skip to content

Commit 7316652

Browse files
authored
Merge pull request #26 from lolli42/recursive-suites
[BUGFIX] Suite nesting may fatal
2 parents 90df480 + 1743314 commit 7316652

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PHPUnitRandomizer/Randomizer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ private function randomizeSuiteThatContainsOtherSuites($suite, $seed)
3939
{
4040
$order = 0;
4141
foreach ($suite->tests() as $test) {
42-
if($this->testSuiteContainsOtherSuites($test)){
42+
if ($test instanceof \PHPUnit\Framework\TestSuite && $this->testSuiteContainsOtherSuites($test)) {
4343
$this->randomizeSuiteThatContainsOtherSuites($test, $seed);
4444
}
45-
$this->randomizeSuite($test, $seed, $this->order);
45+
if ($test instanceof \PHPUnit\Framework\TestSuite) {
46+
$this->randomizeSuite($test, $seed, $this->order);
47+
}
4648
$this->order++;
4749
}
4850
return $this->randomizeSuite($suite, $seed, $this->order, false);

0 commit comments

Comments
 (0)