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

in AutoSuggestAPITest make sure static var overrides are undone after the test finishes #20828

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

diosmosis
Copy link
Member

Description:

Currently this is done outside the test class, in the global scope, which means it will be run if the file is included and not undone. This is a problem if you write your own tests for the autosuggest API in a plugin, and expect the value to be it's default (because phpunit will include the file when running the plugin test suite).

This cost me about ~6 hrs of debugging time to find so I thought I'd prevent it from happening again.

Review

@diosmosis diosmosis added Needs Review PRs that need a code review c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. labels Jun 3, 2023
@sgiehl sgiehl removed the Needs Review PRs that need a code review label Jun 5, 2023
@sgiehl sgiehl added this to the 5.0.0 milestone Jun 5, 2023
@sgiehl sgiehl merged commit a727364 into 5.x-dev Jun 5, 2023
@sgiehl sgiehl deleted the autosuggest-test-setup branch June 5, 2023 06:29
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Tests & QA For issues related to automated tests or making it easier to QA & test issues. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants