Skip to content

Tests: make dataproviders static #255

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

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 11, 2024

Description

As of PHPUnit 10, data providers are (again) expected to be static methods. While the test suite does not (yet) support PHPUnit 10, it's still not a bad idea to already start complying with this.

Suggested changelog entry

N/A

Related issues/external references

Loosely related to #25

As of PHPUnit 10, data providers are (again) expected to be `static` methods.
While the test suite does not (yet) support PHPUnit 10, it's still not a bad idea to already start complying with this.
@jrfnl jrfnl added this to the 3.8.x Next milestone Jan 11, 2024
@jrfnl jrfnl merged commit 1703a6b into master Jan 11, 2024
@jrfnl jrfnl deleted the feature/tests-static-dataproviders branch January 11, 2024 23:26
@jrfnl jrfnl modified the milestones: 3.8.x Next, 3.9.0 Jan 19, 2024
rodrigoprimo added a commit to rodrigoprimo/PHPCSDevTools that referenced this pull request Apr 11, 2025
Per the PHPUnit manual: "A data provider method must be public and static" (https://docs.phpunit.de/en/12.0/writing-tests-for-phpunit.html).

A similar change was done in the PHPCS repository: PHPCSStandards/PHP_CodeSniffer#255
rodrigoprimo added a commit to rodrigoprimo/PHPCSDevTools that referenced this pull request Apr 11, 2025
Per the PHPUnit manual: "A data provider method must be public and static" (https://docs.phpunit.de/en/12.0/writing-tests-for-phpunit.html).

A similar change was done in the PHPCS repository: PHPCSStandards/PHP_CodeSniffer#255

Tests will continue to work when running with PHPUnit < 10.
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