Repository navigation
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
There was a problem hiding this comment.
🟡 Changes recommended
The test retains a redundant nested PHP version guard, leaving duplicate checks to maintain.
1 open issue
What changed in this PR
Expands unit coverage for WP_Plugins_List_Table, complementing existing tests for the WordPress admin plugins screen.
Changes:
- Adds tests for permissions, columns, search matching, status views, and table actions.
- Covers row rendering, automatic updates, drop-ins, multisite restrictions, and compatibility messages.
- Introduces helpers for protected-method access, row rendering, and global-state restoration.
| File | Description |
|---|---|
tests/phpunit/tests/admin/wpPluginsListTable.php |
Adds list-table tests, data providers, and supporting helpers. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks for the thorough coverage, @hmbashar! Expanding coverage for WP_Plugins_List_Table across status views, auto-updates, and network actions is a great addition.
All CI checks are green across the matrix.
One small optional cleanup: in set_property_accessible(), there is a duplicate nested if ( PHP_VERSION_ID < 80100 ) check around line 184. You can keep the outer check and call setAccessible() directly.
Nice work on the suite!
AI Review: Gemini 3.8 Flash
… twice. See #66552.

Summary
Adds tests for the parts of
WP_Plugins_List_Tablethat the existing tests do not cover, intests/phpunit/tests/admin/wpPluginsListTable.php. The class already has tests for the bulk actions, the action links, the dependency rows, the search box andprepare_items()in other files, so these tests add the methods listed in the ticket that were still missing.__construct(): the search term is added to the request URI.ajax_user_can(),get_table_classes(),get_primary_column_name().get_columns(): the default columns and the automatic updates column._search_callback(): the name, description (without markup), author, URL-encoded terms, values that are not strings.get_views(): the label of other statuses, theplugins_list_status_textfilter, escaping, and statuses without plugins.bulk_actions(),extra_tablenav()(the Clear List button and the Must-Use and Drop-ins notes) andcurrent_action().display_rows(), including Must-Use plugins and drop-ins on a site of a network.single_row(): the setting for automatic updates, theplugin_auto_update_setting_htmlfilter, custom columns, drop-in rows and the message for a plugin that is not compatible.Testing
Mutation check: 38 changes to
class-wp-plugins-list-table.php(the capability, the search, the views, the table navigation, the drop-in rows, the automatic updates setting and the compatibility message) were each caught by a test. The two that depend on multisite are caught by the multisite run.Notes: the compatibility message for a user who can update WordPress but not PHP (and the reverse) is tested with a
map_meta_capfilter, becauseupdate_phpmaps toupdate_core.Trac ticket: https://core.trac.wordpress.org/ticket/66552
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Written with AI and manually reviewed by me.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.