[wp-trac] [WordPress Trac] #64895: Tests: Reduce usage of assertEquals for 7.1
WordPress Trac
noreply at wordpress.org
Thu Mar 19 10:40:16 UTC 2026
#64895: Tests: Reduce usage of assertEquals for 7.1
------------------------------+--------------------
Reporter: desrosj | Owner: (none)
Type: task (blessed) | Status: new
Priority: normal | Milestone: 7.1
Component: Build/Test Tools | Version:
Severity: normal | Keywords:
Focuses: |
------------------------------+--------------------
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
To help ease the effort of merging tests, changes should also be made
upstream in the Gutenberg repository.
Follow-up to:
* #64324 (7.0)
* #63169 (6.9)
* #62278 (6.8)
* #61573 (6.7)
* #60706 (6.6)
* #59655 (6.5)
* #58956 (6.4)
* #57855 (6.3)
* #56800 (6.2)
* #55654 (6.1)
* #54726 (6.0)
* #53364 (5.9)
* #52482 (5.8)
* #38266 (5.7)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64895>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list