@@ -49,8 +49,17 @@ protected function setUp(): void
4949 require $ this ->fixturesFolder . '/Encryption.php ' ;
5050 }
5151
52- BaseConfig::$ registrars = [];
53- BaseConfig::setModules (new Modules ()); // reset to clean copy of Modules
52+ BaseConfig::reset ();
53+ }
54+
55+ protected function tearDown (): void
56+ {
57+ parent ::tearDown ();
58+
59+ // This test modifies BaseConfig::$modules, so should reset.
60+ BaseConfig::reset ();
61+ // This test modifies Services locator, so should reset.
62+ $ this ->resetServices ();
5463 }
5564
5665 public function testBasicValues (): void
@@ -271,18 +280,24 @@ public function testBadRegistrar(): void
271280 $ this ->assertSame ('bar ' , $ config ->foo );
272281 }
273282
283+ /**
284+ * @psalm-suppress UndefinedClass
285+ */
274286 public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray (): void
275287 {
276288 /** @var MockObject&Modules $modules */
277289 $ modules = $ this ->createMock (Modules::class);
278290 $ modules ->method ('shouldDiscover ' )->with ('registrars ' )->willReturn (false );
279-
280291 RegistrarConfig::setModules ($ modules );
292+
281293 $ config = new RegistrarConfig ();
282294
283295 $ this ->assertSame ([], $ config ::$ registrars );
284296 }
285297
298+ /**
299+ * @psalm-suppress UndefinedClass
300+ */
286301 public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue (): void
287302 {
288303 /** @var FileLocator&MockObject $locator */
0 commit comments