[wp-trac] [WordPress Trac] #64324: Tests: Reduce usage of assertEquals for 7.0
WordPress Trac
noreply at wordpress.org
Mon Apr 20 23:11:50 UTC 2026
#64324: Tests: Reduce usage of assertEquals for 7.0
--------------------------------------+-------------------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: task (blessed) | Status: closed
Priority: normal | Milestone: 7.0
Component: Build/Test Tools | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: coding-standards
--------------------------------------+-------------------------------
Comment (by SergeyBiryukov):
In [changeset:"62247" 62247]:
{{{
#!CommitTicketReference repository="" revision="62247"
Tests: Use `assertSame()` in `get_adjacent_post()` tests.
This ensures that not only the return values match the expected results,
but also that their type is the same.
Going forward, stricter type checking by using `assertSame()` should
generally be preferred to `assertEquals()` where appropriate, to make the
tests more reliable.
Follow-up to [60733], [61066].
Props sagardeshmukh.
See #64324.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64324#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list