[wp-trac] [WordPress Trac] #59486: Make test suite compatible with PHPUnit 10

WordPress Trac noreply at wordpress.org
Thu Sep 28 08:58:42 UTC 2023


#59486: Make test suite compatible with PHPUnit 10
------------------------------+----------------------------------------
 Reporter:  dingo_d           |      Owner:  (none)
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:  trunk
 Severity:  normal            |   Keywords:  dev-feedback needs-testing
  Focuses:                    |
------------------------------+----------------------------------------
 PHPUnit 10 was released back in February of 2023, and included
 [https://github.com/sebastianbergmann/phpunit/blob/10.0.0/ChangeLog-10.0.md#1000
 ---2023-02-03 many breaking changes] - they completely rewrote the
 internal functionality of PHPUnit (mainly the event system for extending
 the test runner). Besides that, they upped the minimum PHP version to
 >=8.1, so for WordPress, it could only be used on PHP versions of >=8.1.

 While this is not a huge and critical update, since the tests are running
 fine on PHP versions all the way up to version 8.3, it would be a good
 idea to start preparing for PHPUnit 10 compatibility.

 Besides being up to date, it will allow external testing library
 maintainers (such as [https://github.com/lucatume/wp-browser wp-browser]
 or [https://github.com/dingo-d/wp-pest wp-pest]), to use the latest
 versions of both PHPUnit, or dependencies that are using PHPUnit 10 (such
 as PestPHP v2 which depends on PHPUnit 10).

 I understand that this is a huge undertaking, but it's okay to have a
 ticket open for this (I didn't find one opened while searching, could be
 wrong tho), so that we can keep track of changes, and maybe create a
 roadmap or a to-do list of what needs to be fixed in order to make
 WordPress test suite compatible with PHPUnit 10.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59486>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list