Repository navigation
Conversation
…all_List_Table. See #66554.
|
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 tests omit multisite denial for ordinary site administrators and populated-table rendering, allowing capability and plugin-card display regressions to pass.
2 open issues
What changed in this PR
Adds the second set of unit tests for WP_Plugin_Install_List_Table under ticket #66554, covering configuration, views, and display behavior without changing production code.
Changes:
- Tests installation permissions, table classes, columns, and installed plugin slugs.
- Checks tab links, filtering, introductory content, and search-form visibility.
- Verifies navigation placement, featured-tab behavior, and empty-list output.
| File | Description |
|---|---|
tests/phpunit/tests/admin/wpPluginInstallListTableViews.php |
Adds configuration, view, and display tests with shared setup and cleanup. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks for the PR, @hmbashar! Good coverage for WP_Plugin_Install_List_Table tabs, views, and navigation.
All CI checks are green. Two quick observations to consider:
- Multisite capability check (line ~107): In the multisite view test, promoting the user before the assertion means denial for an ordinary site administrator without
install_pluginsisn'''t tested. An assertion verifying denial before super admin promotion would strengthen this. - Populated table display: Testing
display()with mock items populated in$table->itemswould ensuredisplay_rows_or_placeholder()is exercised. - Class naming: Class name uses lowercase
wp(Tests_Admin_wpPluginInstallListTableViews); updating toWpaligns with PHPCS conventions.
AI Review: Gemini 3.8 Flash
…le in display(). See #66554.

Summary
Part 2 of the tests for
WP_Plugin_Install_List_Table(ticket #66554): the configuration, the views and the display of the table. The other parts are separate pull requests, one for each area.display_tablenav()andno_items()already have tests.ajax_user_can()needs theinstall_pluginscapability (a super admin on multisite).get_table_classes()returnswidefatandplugin-install, andget_columns()returns no columns.get_installed_plugin_slugs()lists the slugs of the plugins with and without an update, and ignores the plugins without a slug.get_views()links each tab, marks the current one and leaves out the upload tab.views()outputs the introduction with the link to the plugin directory, the tabs, theviews_plugin-installfilter, an empty list of tabs, and the search form (but not for the favorites).display()outputs the navigation above and below the list, the classes of the table, the list and the message for an empty list, and no navigation for the featured plugins.Testing
Mutation check: 16 changes to
ajax_user_can(),get_table_classes(),get_columns(),get_installed_plugin_slugs(),get_views(),views()anddisplay()were each caught by these tests.The ticket describes the table classes as
plugin-installonly and two columns (name and description). The table addswidefatand has no columns, so the tests use what the class does.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.