[wp-trac] [WordPress Trac] #46149: PHPUnit 8.x support

WordPress Trac noreply at wordpress.org
Fri Jun 11 07:24:02 UTC 2021


#46149: PHPUnit 8.x support
-------------------------------------------------+-------------------------
 Reporter:  SergeyBiryukov                       |       Owner:  netweb
     Type:  task (blessed)                       |      Status:  assigned
 Priority:  high                                 |   Milestone:  Future
                                                 |  Release
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests early php8  |     Focuses:
  needs-dev-note                                 |
-------------------------------------------------+-------------------------

Comment (by jrf):

 The first alpha of PHP 8.1 has been released yesterday and brings with it
 new challenges for getting the tests running on PHP 8.1, so this ticket
 needs to be revived again.

 I know I'm biased, but I would strongly recommend using the
 [https://github.com/Yoast/PHPUnit-Polyfills PHPUnit Polyfills] to solve
 the majority of issues.

 The Polyfills allow for using the expectations and assertions as available
 in PHPUnit 9.x and to still run the tests on PHPUnit 4.8 - 9.x.
 It also includes a `TestCase` solution solving the `void` problem.


 Additionally, I'd like to draw attention to the fact that PHPUnit 9.1.0
 deprecated support for test file names which do not match the class name
 of the test class within.

 Ref: https://github.com/sebastianbergmann/phpunit/pull/4109/

 This means that the test file naming conventions will also need revisiting
 when addressing this ticket.

 Loosely related to #53010 and https://github.com/WordPress/WordPress-
 Coding-Standards/issues/1995.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46149#comment:50>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list