[wp-trac] [WordPress Trac] #52482: Tests: Reduce usage of assertEquals() for 5.8

WordPress Trac noreply at wordpress.org
Wed Jun 23 15:59:54 UTC 2021


#52482: Tests: Reduce usage of assertEquals() for 5.8
-----------------------------------+-----------------------------
 Reporter:  johnbillion            |       Owner:  SergeyBiryukov
     Type:  task (blessed)         |      Status:  closed
 Priority:  normal                 |   Milestone:  5.8
Component:  Build/Test Tools       |     Version:
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  needs-unit-tests php8  |     Focuses:
-----------------------------------+-----------------------------

Comment (by SergeyBiryukov):

 In [changeset:"51220" 51220]:
 {{{
 #!CommitTicketReference repository="" revision="51220"
 Tests: Replace `assertEquals()` with `assertSameSets()` in text widget
 tests.

 This ensures that not only the array values being compared are equal, but
 also that their type is the same.

 Going forward, stricter type checking by using `assertSame()`,
 `assertSameSets()`, or `assertSameSetsWithIndex()` should generally be
 preferred, to make the tests more reliable.

 Follow-up to [40631], [41132], [48939], [51137].

 See #52482, #52625.
 }}}

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


More information about the wp-trac mailing list