[wp-trac] [WordPress Trac] #53363: Test tool and unit test improvements for 5.9
WordPress Trac
noreply at wordpress.org
Mon Aug 30 20:18:47 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:
--------------------------------------+---------------------
Comment (by hellofromTonya):
In [changeset:"51697" 51697]:
{{{
#!CommitTicketReference repository="" revision="51697"
Tests: Test custom assertions parameter data type in
`WP_UnitTestCase_Base`.
The following changes improve tests stability.
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.
Follow-up to [30687], [42343], [48937], [48939], [51480], [51481].
Props jrf.
See #53363.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53363#comment:76>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list