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

WordPress Trac noreply at wordpress.org
Tue Oct 4 15:56:46 UTC 2022


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

Comment (by jrf):

 Replying to [comment:3 SergeyBiryukov]:
 > Would rewriting `reset_post_statuses()` to avoid using
 `get_post_stati()` be a better solution here?
 >
 > At a glance, it looks like `reset_post_types()` and `reset_taxonomies()`
 would also need to avoid using `get_post_types()` and `get_taxonomies()`,
 respectively, as they call `wp_filter_object_list()` as well.

 For what's it's worth - the same problem as outlined in this ticket
 applies to any and all tests involving WP native functions used in the
 `set_up()` methods (and possibly the `tear_down()`, though I'd need to
 check to be sure).

 So swopping out one WP native function for another is not a solution, it
 just "moves" the problem to another part of the test suite.

 More than anything, we need a different setup for tests which don't need
 the whole WP environment to be up and running, but there are other tickets
 open for that.

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


More information about the wp-trac mailing list