Changes between Initial Version and Version 1 of Ticket #56706
- Timestamp:
- 10/01/2022 02:22:45 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #56706 – Description
initial v1 1 1 == How was this discovered? 2 2 3 While adding new tests for ` wp_list_pluck()`, I noticed that the coverage report included coverage that should not have been possible.3 While adding new tests for `WP_List_Util::pluck()`, I noticed that the coverage report included coverage that should not have been possible. 4 4 5 5 == Steps to reproduce 6 6 7 1. Add the following to your PHPUnit configuration file (either `phpunit.xml.dist`, or copy this to `phpunit.xml`.7 1. Add the following to your PHPUnit configuration file, either `phpunit.xml.dist`, or copy this to `phpunit.xml`. 8 8 9 9 {{{#!xml … … 43 43 44 44 5. Click `pluck`. 45 6. 🐞 Observe that `$newlist[ $key ] = $value->$field;` (Line 168) isunexpectedly covered.45 6. 🐞 Observe that parts of this method are unexpectedly covered. 46 46 47 47 == What's happening? … … 54 54 - Which calls `WP_List_Util::pluck()`. 💥 55 55 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()`.56 Since code called in `WP_UnitTestCase_Base::set_up()` is included in coverage reports, this presents an inaccurate coverage report for `WP_List_Util::pluck()`. 57 57 58 58 == Solutions