Skip to content

Commit 3fe865b

Browse files
ptomuliksebastianbergmann
authored andcommitted
fixed #5614
1 parent 43a79f9 commit 3fe865b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Framework/TestCase.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -1836,16 +1836,17 @@ private function registerMockObjectsFromTestArguments(array $testArguments, Cont
18361836
}
18371837
}
18381838
} else {
1839-
foreach ($testArguments as $testArgument) {
1839+
foreach ($testArguments as &$testArgument) {
18401840
if ($testArgument instanceof MockObject) {
18411841
$testArgument = Cloner::clone($testArgument);
18421842

18431843
$this->registerMockObject($testArgument);
18441844
} elseif (is_array($testArgument) && !$context->contains($testArgument)) {
1845+
$testArgumentCopy = $testArgument;
18451846
$context->add($testArgument);
18461847

18471848
$this->registerMockObjectsFromTestArguments(
1848-
$testArgument,
1849+
$testArgumentCopy,
18491850
$context,
18501851
);
18511852
}

0 commit comments

Comments
 (0)