[wp-trac] [WordPress Trac] #59953: PHPunit tests for _wp_timezone_choice_usort_callback

WordPress Trac noreply at wordpress.org
Thu Nov 30 11:15:50 UTC 2023


#59953: PHPunit tests for _wp_timezone_choice_usort_callback
--------------------------------------+---------------------
 Reporter:  pbearne                   |       Owner:  jorbin
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.5
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by SergeyBiryukov):

 In [changeset:"57146" 57146]:
 {{{
 #!CommitTicketReference repository="" revision="57146"
 Tests: Update `_wp_timezone_choice_usort_callback()` tests for
 consistency.

 * Use the same `@group` annotation as the other tests.
 * Use `assertSame()` to verify the type of the result.
 * Use `data_` prefix for the data provider.
 * Use named data set in the data provider. This makes the output when
 using the `--testdox` option more descriptive and is helpful when trying
 to debug which data set from a data provider failed the test.
 * Other minor corrections.

 Reference: [https://make.wordpress.org/core/handbook/testing/automated-
 testing/writing-phpunit-tests/#repetitive-tests Core Handbook: Writing PHP
 Tests: Repetitive Tests].

 Follow-up to [57145].

 See #59953, #59647.
 }}}

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


More information about the wp-trac mailing list