[wp-trac] [WordPress Trac] #64324: Tests: Reduce usage of assertEquals for 7.0
WordPress Trac
noreply at wordpress.org
Mon Dec 29 23:14:11 UTC 2025
#64324: Tests: Reduce usage of assertEquals for 7.0
--------------------------------------+-------------------------------
Reporter: SergeyBiryukov | Owner: (none)
Type: task (blessed) | Status: new
Priority: normal | Milestone: 7.0
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses: coding-standards
--------------------------------------+-------------------------------
Comment (by SergeyBiryukov):
In [changeset:"61417" 61417]:
{{{
#!CommitTicketReference repository="" revision="61417"
Tests: Use `assertSame()` in `wp_count_posts()` 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 [1323/tests], [25554], [27081], [60788].
Props costdev, SergeyBiryukov.
See #64324.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64324#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list