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

WordPress Trac noreply at wordpress.org
Tue Feb 9 21:16:57 UTC 2021


#52482: Tests: Reduce usage of assertSame() for 5.8
------------------------------+------------------------------
 Reporter:  johnbillion       |      Owner:  (none)
     Type:  task (blessed)    |     Status:  new
 Priority:  normal            |  Milestone:  5.8
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-unit-tests
  Focuses:                    |
------------------------------+------------------------------
 Follow-up to:

 * #38266 for 5.7

 The `assertEquals()` test method does not check that the types of the
 expected and actual values match. This can hide subtle bugs especially
 when the values are falsey.

 Tasks:

 * Use `assertSame()` when the type of the value in the assertion is
 important
 * Replace overall usage of `assertEquals()` with type-strict assertion
 methods, with the aim of potentially removing its usage altogether

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


More information about the wp-trac mailing list