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

WordPress Trac noreply at wordpress.org
Wed Aug 11 23:08:54 UTC 2021


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

Comment (by jrf):

 Replying to [comment:117 SergeyBiryukov]:
 > @jrf Looks like [51602] [https://github.com/WordPress/wordpress-
 develop/runs/3301987804 broke the tests] for PHP 5.6 and 7.0 (PHPUnit
 5.7.27 and PHPUnit 6.5.14, respectively):
 > {{{
 > There was 1 error:
 >
 > 1) Tests_oEmbed_HTTP_Headers::test_rest_pre_serve_request_headers
 > Error: Call to undefined function xdebug_get_headers()
 >
 > /var/www/tests/phpunit/tests/oembed/headers.php:32
 > }}}
 >
 > I guess we'll still need to call `parent::checkRequirements()` there?
 That fixes the tests for me.


 Correct. As the method in PHPUnit 5 and 6 is still an overload of the
 PHPUnit native method, the `@requires function xdebug_get_headers` tags in
 the test method docblocks were not being correctly handled (for the two
 tests which are normally only run in the `xdebug` group).

 Let's prevent the fatal error on PHPUnit >= 7.0 though, just in case
 people would call the WP version of the method in their tests.

 I've uploaded a fixed version of the patch and ran a test build which is
 now passing:
 https://github.com/jrfnl/wordpress-develop-
 official/actions/runs/1121782154

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


More information about the wp-trac mailing list