[wp-trac] [WordPress Trac] #53364: Tests: Reduce usage of assertEquals for 5.9

WordPress Trac noreply at wordpress.org
Mon Nov 29 08:45:46 UTC 2021


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

Comment (by SergeyBiryukov):

 In [changeset:"52266" 52266]:
 {{{
 #!CommitTicketReference repository="" revision="52266"
 Tests: Replace `assertEquals()` with `assertSame()` in block template
 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()`,
 `assertSameSets()`, or `assertSameSetsWithIndex()` should generally be
 preferred, to make the tests more reliable.

 Follow-up to [51003], [51079], [52062], [52265].

 See #53364, #53363, #54335.
 }}}

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


More information about the wp-trac mailing list