Skip to content

Commit ccbddae

Browse files
committed
test: reset state after testing
Mocks should be removed.
1 parent 7cd5c99 commit ccbddae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/system/Config/BaseConfigTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,14 @@ public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void
276276
/** @var MockObject&Modules $modules */
277277
$modules = $this->createMock(Modules::class);
278278
$modules->method('shouldDiscover')->with('registrars')->willReturn(false);
279-
280279
RegistrarConfig::setModules($modules);
280+
281281
$config = new RegistrarConfig();
282282

283283
$this->assertSame([], $config::$registrars);
284+
285+
// Reset Modules Config.
286+
RegistrarConfig::setModules(new Modules());
284287
}
285288

286289
public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): void
@@ -295,5 +298,8 @@ public function testRedoingDiscoveryWillStillSetDidDiscoveryPropertyToTrue(): vo
295298
$config = new RegistrarConfig();
296299

297300
$this->assertTrue($this->getPrivateProperty($config, 'didDiscovery'));
301+
302+
// Reset locator.
303+
$this->resetServices();
298304
}
299305
}

0 commit comments

Comments
 (0)