[wp-trac] [WordPress Trac] #56706: Tests: `parent::set_up()` calls `wp_list_pluck()`, causing inaccurate coverage.

WordPress Trac noreply at wordpress.org
Tue Feb 14 18:19:49 UTC 2023


#56706: Tests: `parent::set_up()` calls `wp_list_pluck()`, causing inaccurate
coverage.
-------------------------------------------------+-------------------------
 Reporter:  costdev                              |       Owner:
                                                 |  hellofromTonya
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.2
Component:  Build/Test Tools                     |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-screenshots has-patch commit     |     Focuses:
  has-unit-tests                                 |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55341" 55341]:
 {{{
 #!CommitTicketReference repository="" revision="55341"
 Build/Test Tools: Fix inaccurate coverage in
 Tests_Functions_wpListPluck::set_up().

 The call stack for `WP_UnitTestCase_Base::set_up()` includes a call to
 `WP_List_Util::pluck()`, which creates an inaccurate coverage report for
 this method.

 To resolve, `parent::set_up()` is removed from
 `Tests_Functions_wpListPluck::set_up()`.

 To ensure that deprecation and incorrect usage notices continue to be
 detectable, `$this->expectDeprecated()` is added in the test's `set_up()`
 fixture.

 Follow-up to [51663], [28900].

 Props costdev, jrf, SergeyBiryukov, audrasjb.
 Fixes #56706.
 }}}

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


More information about the wp-trac mailing list