Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #56706


Ignore:
Timestamp:
10/01/2022 02:22:45 AM (19 months ago)
Author:
costdev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #56706 – Description

    initial v1  
    11== How was this discovered?
    22
    3 While adding new tests for `wp_list_pluck()`, I noticed that the coverage report included coverage that should not have been possible.
     3While adding new tests for `WP_List_Util::pluck()`, I noticed that the coverage report included coverage that should not have been possible.
    44
    55== Steps to reproduce
    66
    7 1. Add the following to your PHPUnit configuration file (either `phpunit.xml.dist`, or copy this to `phpunit.xml`.
     71. Add the following to your PHPUnit configuration file, either `phpunit.xml.dist`, or copy this to `phpunit.xml`.
    88
    99{{{#!xml
     
    4343
    44445. Click `pluck`.
    45 6. 🐞 Observe that `$newlist[ $key ] = $value->$field;` (Line 168) is unexpectedly covered.
     456. 🐞 Observe that parts of this method are unexpectedly covered.
    4646
    4747== What's happening?
     
    5454- Which calls `WP_List_Util::pluck()`. 💥
    5555
    56 Since code called in `WP_UnitTestCase_Base::set_up()` is included in coverage reports, this presents an inaccurate coverage report for `wp_list_pluck()/WP_List_Util::pluck()`.
     56Since code called in `WP_UnitTestCase_Base::set_up()` is included in coverage reports, this presents an inaccurate coverage report for `WP_List_Util::pluck()`.
    5757
    5858== Solutions