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

PHPUnit tests: fix deprecation notices on PHPUnit 10 #9

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Sep 12, 2024

PHPUnit 11 will be stricter about the data passed from data providers to test methods.

  • The amount of parameters passed has to match the expected number of parameters exactly.
  • If the data sets use keys, the parameter names have to match the keys as used in each data set (inner array).

PHPUnit 10 warns about these changes via deprecation notices.

As the success and fail tests use the same input and to avoid duplication, I've added some interim data provider methods to prevent the deprecation notices and allow for update to PHPUnit 11, while still avoiding data duplication.

PHPUnit 11 will be stricter about the data passed from data providers to test methods.
* The amount of parameters passed has to match the expected number of parameters exactly.
* If the data sets use keys, the parameter names have to match the keys as used in each data set (inner array).

PHPUnit 10 warns about these changes via deprecation notices.

As the success and fail tests use the same input and to avoid duplication, I've added some interim data provider methods to prevent the deprecation notices and allow for update to PHPUnit 11, while still avoiding data duplication.
@jrfnl jrfnl mentioned this pull request Sep 12, 2024
Copy link
Member

@solardiz solardiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look wrong. ;-)

@solardiz
Copy link
Member

Thank you @jrfnl! Not a proper review from me, but I'll trust you this is right.

@solardiz solardiz merged commit b92823e into openwall:main Sep 12, 2024
28 checks passed
@jrfnl jrfnl deleted the feature/tests-phpunit10-prevent-phpunit-deprecation-notices branch September 12, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants