Skip to content

Commit

Permalink
test: reset state after testing
Browse files Browse the repository at this point in the history
Mocks should be removed.
  • Loading branch information
kenjis committed Oct 25, 2023
1 parent 7cd5c99 commit ccbddae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/system/Config/BaseConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,14 @@ public function testDiscoveryNotEnabledWillNotPopulateRegistrarsArray(): void
/** @var MockObject&Modules $modules */
$modules = $this->createMock(Modules::class);
$modules->method('shouldDiscover')->with('registrars')->willReturn(false);

RegistrarConfig::setModules($modules);

Check failure on line 279 in tests/system/Config/BaseConfigTest.php

View workflow job for this annotation

GitHub Actions / Psalm Analysis

UndefinedClass

tests/system/Config/BaseConfigTest.php:279:9: UndefinedClass: Class, interface or enum named RegistrarConfig does not exist (see https://psalm.dev/019)

$config = new RegistrarConfig();

$this->assertSame([], $config::$registrars);

// Reset Modules Config.
RegistrarConfig::setModules(new Modules());
}

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

Check failure on line 298 in tests/system/Config/BaseConfigTest.php

View workflow job for this annotation

GitHub Actions / Psalm Analysis

UndefinedClass

tests/system/Config/BaseConfigTest.php:298:23: UndefinedClass: Class, interface or enum named RegistrarConfig does not exist (see https://psalm.dev/019)

$this->assertTrue($this->getPrivateProperty($config, 'didDiscovery'));

// Reset locator.
$this->resetServices();
}
}

0 comments on commit ccbddae

Please sign in to comment.