[wp-trac] [WordPress Trac] #59655: Tests: Reduce usage of assertEquals for 6.5

WordPress Trac noreply at wordpress.org
Mon Feb 19 15:06:01 UTC 2024


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

Comment (by SergeyBiryukov):

 In [changeset:"57656" 57656]:
 {{{
 #!CommitTicketReference repository="" revision="57656"
 Tests: Use `assertSame()` in `WP_REST_Navigation_Fallback_Controller`
 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 [56052].

 See #59655.
 }}}

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


More information about the wp-trac mailing list