[wp-trac] [WordPress Trac] #62278: Tests: Reduce usage of assertEquals for 6.8

WordPress Trac noreply at wordpress.org
Fri Mar 21 23:46:30 UTC 2025


#62278: Tests: Reduce usage of assertEquals for 6.8
--------------------------------------+---------------------
 Reporter:  desrosj                   |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  6.8
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by SergeyBiryukov):

 In [changeset:"60067" 60067]:
 {{{
 #!CommitTicketReference repository="" revision="60067"
 Tests: Use `assertSame()` in REST API schema sanitization 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 [39061], [48937].

 See #62278.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62278#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list