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

WordPress Trac noreply at wordpress.org
Sun Jun 19 15:19:33 UTC 2022


#55652: Test tool and unit test improvements for 6.1
--------------------------------------+---------------------
 Reporter:  hellofromTonya            |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  6.1
Component:  Build/Test Tools          |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by SergeyBiryukov):

 In [changeset:"53524" 53524]:
 {{{
 #!CommitTicketReference repository="" revision="53524"
 Tests: Refactor `Tests_Image_Functions::test_is_image_negative()` to use a
 data provider.

 Using a data provider has a number of advantages:
 1. If the first test case fails, it won't prevent the other test cases
 from being tested.
 2. While the assertion used in this test method ''does'' have a "failure
 message" (👍), the output from PHPUnit itself will already be more
 descriptive in case of failure when using a data provider.
 3. Using named test cases in the data provider will also make the
 `--testdox` output much more descriptive and informative.

 The actual cases being tested, or the test itself have not been changed.

 Includes:
 * Adding a `@covers` annotation.

 Follow-up to [184/tests], [53495], [53497], [53521], [53523].

 Props jrf.
 See #55652.
 }}}

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


More information about the wp-trac mailing list