@@ -49,8 +49,17 @@ protected function setUp(): void
49
49
require $ this ->fixturesFolder . '/Encryption.php ' ;
50
50
}
51
51
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 ();
54
63
}
55
64
56
65
public function testBasicValues (): void
@@ -271,18 +280,24 @@ public function testBadRegistrar(): void
271
280
$ this ->assertSame ('bar ' , $ config ->foo );
272
281
}
273
282
283
+ /**
284
+ * @psalm-suppress UndefinedClass
285
+ */
274
286
public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray (): void
275
287
{
276
288
/** @var MockObject&Modules $modules */
277
289
$ modules = $ this ->createMock (Modules::class);
278
290
$ modules ->method ('shouldDiscover ' )->with ('registrars ' )->willReturn (false );
279
-
280
291
RegistrarConfig::setModules ($ modules );
292
+
281
293
$ config = new RegistrarConfig ();
282
294
283
295
$ this ->assertSame ([], $ config ::$ registrars );
284
296
}
285
297
298
+ /**
299
+ * @psalm-suppress UndefinedClass
300
+ */
286
301
public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue (): void
287
302
{
288
303
/** @var FileLocator&MockObject $locator */
0 commit comments