[wp-trac] [WordPress Trac] #46043: Unit Tests for the __return functions in functions.php

WordPress Trac noreply at wordpress.org
Sun Jan 20 01:40:55 UTC 2019


#46043: Unit Tests for the __return functions in functions.php
--------------------------------------+------------------------------
 Reporter:  pbearne                   |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------
Changes (by johnbillion):

 * keywords:  has-patch dev-feedback has-unit-tests => has-patch has-unit-
     tests
 * version:  trunk =>


Comment:

 `test__return_zero()` and `test__return_empty_string()` need to use
 `assertSame()` instead of `assertEquals()` otherwise they use loose type
 comparison, which makes the tests unreliable.

 `test__return_true()` and `test__return_false()` shouldn't cast to boolean
 otherwise they too are unreliable.

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


More information about the wp-trac mailing list