Skip to content

Commit 6dbed4c

Browse files
authored
Merge pull request #62326 from nextcloud/jtr/test-fix-TestCase-restoreService
test(TestCase): restore unregistered services correctly
2 parents 7c0e3b4 + b6d59e5 commit 6dbed4c

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
@@ -96,7 +96,9 @@ public function restoreService(string $name): bool {
9696
return $oldService;
9797
});
9898
} else {
99-
unset($container[$oldService]);
99+
// The service was not registered before the test override.
100+
// Remove the test registration so the container returns to its prior state.
101+
unset($container[$name]);
100102
}
101103

102104
unset($this->services[$name]);

0 commit comments

Comments
 (0)