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

WordPress Trac noreply at wordpress.org
Sat Aug 28 23:51:44 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-10-custom-assertions-more-stabilizing.patch" added.

 WP_UnitTestCase_Base: more improvements to custom assertions  The
 `assertEqualFields()` method expects an object and a fields array as
 inputs and subsequently approaches the received parameters as such, but
 did not verify whether the received parameters are of the expected types.
 Along the same lines, the `assertSameSets()`, `assertEqualSets()`,
 `assertSameSetsWithIndex()` and the `assertEqualSetsWithIndex()` methods
 all expect arrays for both the actual as well as the expected values and
 uses the array function `[k]sort()` on both, but never verified that the
 received inputs were actually arrays, which could lead to PHP errors on
 the sorting function calls.

-- 
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