[wp-trac] [WordPress Trac] #53363: Test tool and unit test improvements for 5.9

WordPress Trac noreply at wordpress.org
Mon Aug 30 20:40:20 UTC 2021


#53363: Test tool and unit test improvements 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:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by hellofromTonya):

 In [changeset:"51698" 51698]:
 {{{
 #!CommitTicketReference repository="" revision="51698"
 Tests: Do whitespace replacement in `assertDiscardWhitespace()` only when
 string.

 The `assertDiscardWhitespace()` method uses `assertEquals()` under the
 hood, meaning that in reality any type of actual/expected value should be
 accepted by the function. Fixed the documentation to reflect that.

 At the same time, only strings can contain whitespace differences. So the
 whitespace replacement should only be done when string values are passed.

 This change (a) prevents potential `passing null to non-nullable` errors
 on PHP 8.1, if either of the inputs would turn out to be `null` and (b)
 increases tests stability.

 Follow-up to [35003], [44902].

 Props jrf.
 See #53363.
 }}}

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


More information about the wp-trac mailing list