7

PHPUnit 10 Shift

 1 year ago
source link: https://laravelshift.com/upgrade-phpunit-10
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

PHPUnit 10 Shift

The PHPUnit 10 Shift automates the upgrade of your PHPUnit 9 test suite to PHPUnit 10. Using the PHPUnit 10 Shift to automatically upgrade your PHPUnit test suite has an estimated time savings of 1 hour.

PHPUnit 10 is the latest stable release. This means both PHPUnit and the PHPUnit 10 Shift will continue to receive updates.

Screenshot of a pull request with automated changes from the PHPUnit 10 Shift

Requirements

  • Running PHP 8.1 or higher.
  • Previously running PHPUnit 9 or higher.
  • Test classes within the tests folder.

Automated Changes

  • Updating phpunit/phpunit composer dependency to ^10.0.
  • Bumping community package dependencies for PHPUnit 10.
  • Renaming core assertions, such as assertDirectoryNotExists to assertDirectoryDoesNotExist.
  • Detecting calls to removed assertions, such as assertEqualXMLStructure.
  • Adopting PHP attributes instead of DocBlock annotations in test classes.
  • Marking data providers as static.
  • Adding return types to test cases and data providers.
  • Declaring test classes as final.

Manual Changes

While the PHPUnit 10 Shift addresses most of the backward incompatible changes, you may wish to review the release notes for additional details.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK