[wp-trac] [WordPress Trac] #53363: Test tool and unit test improvements for 5.9

WordPress Trac noreply at wordpress.org
Sat Aug 28 23:52:16 UTC 2021


#53363: Test tool and unit test improvements for 5.9
--------------------------------------+---------------------
 Reporter:  desrosj                   |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  5.9
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------
Changes (by jrf):

 * Attachment "53363-11-custom-assertions-improve-
 assertDiscardWhitespace.patch" added.

 WP_UnitTestCase_Base::assertDiscardWhitespace(): stabilize the custom
 assertion  The `assertDiscardWhitespace()` method uses `assertEquals()`
 under the hood, meaning that in reality any type of actual/expected value
 should be accepted by the function. Fixed the documentation to reflect
 that.  At the same time, only strings can contain whitespace differences,
 so the whitespace replacement should only be done when string values are
 passed.  This will prevent potential `passing null to non-nullable` errors
 on PHP 8.1, if either of the inputs would turn out to be `null`.

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


More information about the wp-trac mailing list