Skip to content

Commit e8d268f

Browse files
joshtrichardsbackportbot[bot]
authored andcommitted
test(TestCase): restore unregistered services correctly
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 parent ccc8521 commit e8d268f

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)