Skip to content

Commit

Permalink
fixed #5614
Browse files Browse the repository at this point in the history
  • Loading branch information
ptomulik authored and sebastianbergmann committed Dec 12, 2023
1 parent 43a79f9 commit 3fe865b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1836,16 +1836,17 @@ private function registerMockObjectsFromTestArguments(array $testArguments, Cont
}
}
} else {
foreach ($testArguments as $testArgument) {
foreach ($testArguments as &$testArgument) {
if ($testArgument instanceof MockObject) {
$testArgument = Cloner::clone($testArgument);

$this->registerMockObject($testArgument);
} elseif (is_array($testArgument) && !$context->contains($testArgument)) {
$testArgumentCopy = $testArgument;
$context->add($testArgument);

$this->registerMockObjectsFromTestArguments(
$testArgument,
$testArgumentCopy,
$context,
);
}
Expand Down

0 comments on commit 3fe865b

Please sign in to comment.