[wp-trac] [WordPress Trac] #54183: Tests: decide on how to handle deprecations in PHPUnit

WordPress Trac noreply at wordpress.org
Sun Sep 26 01:25:15 UTC 2021


#54183: Tests: decide on how to handle deprecations in PHPUnit
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:  (none)
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  5.9
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion needs-dev-note php81     |     Focuses:
  has-patch has-unit-tests                       |
-------------------------------------------------+-------------------------

Comment (by netweb):

 I'm seeing an instance of this in the PR I created a few hours before this
 ticket was created:

 > https://github.com/WordPress/wordpress-develop/pull/1709


 PHPUnit Tests currently fail on PHP 7.2, 7.3, 7.4, & 8.0 which are CI runs
 that use PHPUnit 9.5.10 and 8.5.21:

 {{{
 There was 1 failure:

 1) Tests_Compat_jsonEncodeDecode::test_json_encode_decode
 Failed asserting that exception of type
 "PHPUnit\Framework\Error\Deprecated" is thrown.

 }}}

 The test file source is [https://github.com/WordPress/wordpress-
 develop/blob/e0359da2c154d524f284aa3dad5523d6d61ff1b0/tests/phpunit/tests/compat/jsonEncodeDecode.php#L10
 here], migrated from [https://github.com/WordPress/wordpress-
 develop/commit/237efb530448bdaac3d2aa0d7db94500bcf1c144#diff-
 aa816e2415de60ee0a231aff337f1e4be7dd9ff79f771c32685c38284b3544b9L182-L190
 here] via r51852


 I've created a PR with the option-2 patch https://github.com/WordPress
 /wordpress-develop/pull/1710


 Maybe go for option-2 now whilst further researching option-3?

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


More information about the wp-trac mailing list