From b6d59e53d9b4707f55b005aa41394fa7fce1277f Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 19 Jul 2026 10:33:33 -0400 Subject: [PATCH] test(TestCase): restore unregistered services correctly Signed-off-by: Josh --- tests/lib/TestCase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index aa091b98113ef..0c90b7fb91728 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -96,7 +96,9 @@ public function restoreService(string $name): bool { return $oldService; }); } else { - unset($container[$oldService]); + // The service was not registered before the test override. + // Remove the test registration so the container returns to its prior state. + unset($container[$name]); } unset($this->services[$name]);