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: data set keys should match parameter names #345

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Feb 18, 2024

Description

Initially to prevent issues with a few PHPUnit versions which were around in the early days of PHP 8.0, where these would accidentally be seen as parameter names.

So, as a best practice, when using keys in data sets, the keys should match the parameter names of the receiving test method.

An ulterior reason to make this change is that PHPUnit 11 will always treat the keys as parameter names, so this can be seen as a preparation step for allowing for PHPUnit 11 support in PHPCS 4.0.

Suggested changelog entry

N/A

Related issues/external references

Loosely related to #25

Initially to prevent issues with a few PHPUnit versions which were around in the early days of PHP 8.0, where these would accidentally be seen as parameter names.

So, as a best practice, when using keys in data sets, the keys should match the parameter names of the receiving test method.

An ulterior reason to make this change is that PHPUnit 11 will always treat the keys as parameter names, so this can be seen as a preparation step for allowing for PHPUnit 11 support in PHPCS 4.0.
@jrfnl jrfnl added this to the 3.9.x Next milestone Feb 18, 2024
@jrfnl jrfnl merged commit fbde507 into master Feb 18, 2024
46 checks passed
@jrfnl jrfnl deleted the feature/tests-fix-up-a_few-dataproviders branch February 18, 2024 00:30
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