[wp-trac] [WordPress Trac] #64324: Tests: Reduce usage of assertEquals for 7.0
WordPress Trac
noreply at wordpress.org
Sun Apr 26 23:57:42 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 peterwilsoncc):
In [changeset:"62265" 62265]:
{{{
#!CommitTicketReference repository="" revision="62265"
Tests: Use `assertSame()` in `WP_AI_Client_Prompt_Builder` 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 [61700].
Reviewed by peterwilsoncc.
Merges r62248 to the 7.0 branch.
Props sagardeshmukh, SergeyBiryukov.
See #64324.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64324#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list