test(TestCase): restore unregistered services correctly

Signed-off-by: Josh <josh.t.richards@gmail.com>
pull/62326/head
Josh 1 month ago committed by GitHub
parent d49f90b80e
commit b6d59e53d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      tests/lib/TestCase.php

@ -96,7 +96,9 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
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]);

Loading…
Cancel
Save