-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix BaseConfigTest #8095
test: fix BaseConfigTest #8095
Conversation
Mocks should be removed.
35044a8
to
bfecd50
Compare
$config = new RegistrarConfig(); | ||
|
||
$this->assertSame([], $config::$registrars); | ||
|
||
// Reset Modules Config. | ||
RegistrarConfig::setModules(new Modules()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already done in setUp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but if the test method moves to the last, the mock object remains.
Since we are using static properties, we have to reset them again and again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it should be added in tearDown also so if the test fails, resetting will still be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added tearDown() and so on.
It would be much easier without static properties.
Description
Closes #8094
Follow-up #8036
BaseConfig::reset()
for testingChecklist: