[wp-trac] [WordPress Trac] #61573: Tests: Reduce usage of assertEquals for 6.7

WordPress Trac noreply at wordpress.org
Thu Jul 4 15:09:31 UTC 2024


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

Comment (by SergeyBiryukov):

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

 See #61573.
 }}}

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


More information about the wp-trac mailing list