[wp-trac] [WordPress Trac] #53364: Tests: Reduce usage of assertEquals for 5.9
WordPress Trac
noreply at wordpress.org
Wed Jun 9 00:11:17 UTC 2021
#53364: Tests: Reduce usage of assertEquals for 5.9
------------------------------+-----------------------------------
Reporter: desrosj | Owner: (none)
Type: task (blessed) | Status: new
Priority: normal | Milestone: 5.9
Component: Build/Test Tools | Version:
Severity: normal | Keywords: needs-unit-tests php8
Focuses: |
------------------------------+-----------------------------------
Follow-up to:
* #52482 for 5.8
* #38266 for 5.7
The `assertEquals()` test method does not check that the types of the
expected and actual values match. This can hide subtle bugs especially
when the values are falsey.
Tasks:
* Switch to using `assertSame()` when the type of the value in the
assertion is important
* Replace overall usage of `assertEquals()` with type-strict assertion
methods, with the aim of potentially removing its usage altogether
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53364>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list