[wp-trac] [WordPress Trac] #38266: Tests: Use assertSame() when the type of the value in the assertion is important

WordPress Trac noreply at wordpress.org
Wed Aug 26 02:23:45 UTC 2020


#38266: Tests: Use assertSame() when the type of the value in the assertion is
important
------------------------------+-----------------------------
 Reporter:  johnbillion       |       Owner:  SergeyBiryukov
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  5.6
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  needs-unit-tests  |     Focuses:
------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => accepted
 * milestone:  Future Release => 5.6


Comment:

 Wanted to create a ticket for this, but found this one instead and would
 like to pick it up :)

 In the same way that it is considered best practice per the coding
 standards to use strict comparisons, I think it would be beneficial to
 switch most of the tests to use `assertSame()` instead of `assertEquals()`
 where possible.

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


More information about the wp-trac mailing list