Skip to content
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

Tests: minor stability tweak #356

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Feb 20, 2024

Description

Follow up on #275

While tests should always clean up after themselves, this little tweak at least prevents tests which set the $_SERVER global (and don't reset it after the test is finished) from influencing tests which use these abstract test cases.

Explanation: the $_SERVER global is not automatically reset between tests by PHPUnit and the Config class will read it out when it is set, so if one tests set the global and doesn't reset it, the next test with get a Config instance which will use the args set in the $_SERVER['argv'] from the previous test.

Suggested changelog entry

N/A

Follow up on 275

While tests should always clean up after themselves, this little tweak at least prevents tests which set the `$_SERVER` global (and don't reset it after the test is finished) from influencing tests which use these abstract test cases.

_Explanation: the `$_SERVER` global is not automatically reset between tests by PHPUnit and the `Config` class _will_ read it out when it is set, so if one tests set the global and doesn't reset it, the next test with get a `Config` instance which will use the args set in the `$_SERVER['argv']` from the previous test._
@jrfnl jrfnl added this to the 3.9.x Next milestone Feb 20, 2024
@jrfnl jrfnl enabled auto-merge February 20, 2024 17:21
@jrfnl jrfnl merged commit 45c61f5 into master Feb 20, 2024
46 checks passed
@jrfnl jrfnl deleted the feature/tests-yet-another-stability-tweak branch February 20, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant