[wp-trac] [WordPress Trac] #60706: Tests: Reduce usage of assertEquals for 6.6

WordPress Trac noreply at wordpress.org
Mon Jun 24 15:13:10 UTC 2024


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

Comment (by SergeyBiryukov):

 In [changeset:"58478" 58478]:
 {{{
 #!CommitTicketReference repository="" revision="58478"
 Tests: Use `assertSame()` in `WP_Theme_JSON` 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 [55959], [55986], [57547], [57716], [58244], [58422].

 See #60706.
 }}}

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


More information about the wp-trac mailing list