[wp-trac] [WordPress Trac] #55654: Tests: Reduce usage of assertEquals for 6.1

WordPress Trac noreply at wordpress.org
Mon May 2 15:17:59 UTC 2022


#55654: Tests: Reduce usage of assertEquals for 6.1
------------------------------+--------------------
 Reporter:  hellofromTonya    |      Owner:  (none)
     Type:  task (blessed)    |     Status:  new
 Priority:  normal            |  Milestone:  6.1
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+--------------------
 Follow-up to:

 * #54726 (6.0)
 * #53364 (5.9)
 * #52482 (5.8)
 * #38266 (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:

 * Switch to using `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

 To help ease the effort of backporting tests, changes should also be made
 upstream in the Gutenberg repository.

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


More information about the wp-trac mailing list