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.
🟢 Approval recommended
No active review issues are reported for the added plugin installation list-table tests.
No open issues 🎉
What changed in this PR
Adds unit tests for WP_Plugin_Install_List_Table::prepare_items() as part of ticket #66554, expanding plugin installation list-table coverage without changing production code.
Changes:
- Covers tab selection, filters, API arguments, search, and favorites handling.
- Checks response items, pagination, groups, API errors, and plugin sorting.
- Verifies installed-plugin data sent to the updates script, with isolated API responses and restored test globals.
| File | Description |
|---|---|
tests/phpunit/tests/admin/wpPluginInstallListTablePrepareItems.php |
Adds tests for list-table preparation, sorting, and updates-script data. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Great work covering WP_Plugin_Install_List_Table::prepare_items(), @hmbashar! Detailed testing of pagination, query arguments, tabs, and error paths.
All 96 CI matrix runs pass.
One minor coding standard detail: in tests/phpunit/tests/admin/wpPluginInstallListTablePrepareItems.php, the class name is currently Tests_Admin_wpPluginInstallListTablePrepareItems with a lowercase wp. Capitalizing to Tests_Admin_WpPluginInstallListTablePrepareItems will match standard Core naming conventions.
AI Review: Gemini 3.8 Flash
|
Thanks for the review, @huzaifaalmesbah. I kept the lowercase |
Summary
Part 1 of the tests for
WP_Plugin_Install_List_Table(ticket #66554):prepare_items()and the sorting of the plugins. The class is big, so the tests are in several pull requests, one for each area.no_items()andget_dependencies_notice()already have tests, and the open PR forget_installed_plugins()is separate.install_plugins_tabsandinstall_plugins_nonmenu_tabsfilters.$typeand$term), and the favorites (the user option, saving the user with a nonce,save=0, an invalid nonce, no user, and the favorites form).install_plugins_table_api_args_{$tab}filter, and that the API is not asked without arguments.updatesscript.Testing
Mutation check: 32 changes to
prepare_items(),order_callback()andget_installed_plugins()(the tabs and their filters, the arguments of each tab, the favorites flow, the pagination, the sorting and the script data) were each caught by a test.The tests set
$wp_versionto a version that is not a pre-release (the beta tab is listed for pre-releases), and use a newWP_Scriptsinstance.Trac ticket: https://core.trac.wordpress.org/ticket/66554
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.