Skip to content

Commit fc7876a

Browse files
Merge pull request #62790 from nextcloud/backport/62326/stable34
[stable34] test(TestCase): restore unregistered services correctly
2 parents a0ede50 + e8d268f commit fc7876a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/lib/TestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public function restoreService(string $name): bool {
9494
return $oldService;
9595
});
9696
} else {
97-
unset($container[$oldService]);
97+
// The service was not registered before the test override.
98+
// Remove the test registration so the container returns to its prior state.
99+
unset($container[$name]);
98100
}
99101

100102

0 commit comments

Comments
 (0)