[wp-trac] [WordPress Trac] #53997: Add some unit tests for the WP_Upgrader class

WordPress Trac noreply at wordpress.org
Wed Mar 30 00:20:07 UTC 2022


#53997: Add some unit tests for the WP_Upgrader class
--------------------------------------+---------------------
 Reporter:  SergeyBiryukov            |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  6.0
Component:  Upgrade/Install           |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+---------------------

Comment (by costdev):

 [https://github.com/WordPress/wordpress-develop/pull/1751 PR 1751] on
 #54245 uses `getMockBuilder()`.

 [https://github.com/WordPress/wordpress-develop/pull/2463 PR 2463] above
 uses `WP_Upgrader` directly and aims to achieve 100% (or as near as
 possible) line/branch coverage for `WP_Upgrader`.

 #54245 notes that there is accidental coverage of `WP_Upgrader` elsewhere
 in the test suite, though a single test class that covers each line/branch
 and in doing so, demonstrates how to hit each line/branch for future path
 coverage improvements, would be ideal IMO.

 It would be good to get some input on the preferred approach for Core.

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


More information about the wp-trac mailing list