validation icon indicating copy to clipboard operation
validation copied to clipboard

PHPUnit 10 Shift

Open adrianmiu opened this issue 2 years ago • 5 comments

This pull request contains changes for upgrading to PHPUnit 10 automated by the PHPUnit 10 Shift.

Before merging, you need to:

  • Checkout the shift-95980 branch
  • Review all pull request comments for additional changes
  • Run composer update (if the scripts fail, add --no-scripts)
  • Run your tests suite: vendor/bin/phpunit

If there were changes you felt could have been automated, please reply to the follow-up email with your feedback or on Twitter.

adrianmiu avatar Jul 20 '23 10:07 adrianmiu

:warning: PHPUnit 10 requires PHP version 8.1 or higher. Be sure to verify you met this requirement by running php -v in your test environment.

adrianmiu avatar Jul 20 '23 10:07 adrianmiu

:information_source: PHPUnit has documented using return types for test cases and data providers since PHPUnit 8. In an effort to modernize your test suite, Shift added a return type of void to your test cases and a return type of array to your data providers.

Shift understands developers have different preferences when it comes to type hints. If you do not wish to add return types, you may undo this change by running git revert f9601298.

adrianmiu avatar Jul 20 '23 10:07 adrianmiu

:information_source: PHPUnit has documented declaring test classes as final since PHPUnit 8. In an effort to modernize your test suite, Shift has declared your test classes as final.

Shift understands developers have different preferences when it comes to using final. If you do not wish to declare your test classes as final, you may undo this change by running git revert fbc3fca3.

adrianmiu avatar Jul 20 '23 10:07 adrianmiu

:warning: PHPUnit 10 now requires any base test class to have a TestCase suffix. In addition, this class should be defined as abstract. If you have a custom base test class, you should ensure it meets these new requirements.

adrianmiu avatar Jul 20 '23 10:07 adrianmiu

:alembic: This Shift is still being refined. Please report any issues or suggestions to [email protected]. Your feedback is what helps improve the experience for everyone.

adrianmiu avatar Jul 20 '23 10:07 adrianmiu