Repository navigation
Tests: Add unit test coverage for WP_Plugins_List_Table::no_items() - #14585
huzaifaalmesbah wants to merge 2 commits into
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the 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. |
…no_items() tests.
|
Small follow-up in ec3b7ae: |
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in the focused test-only changes; tests were not executed.
No open issues 🎉
What changed in this PR
Adds unit coverage for the Plugins screen’s empty-state messages without changing production code.
Changes:
- Tests empty plugin lists, unmatched views, and empty search terms.
- Covers search escaping and directory-link visibility by capability and multisite status.
| File | Description |
|---|---|
| tests/phpunit/tests/admin/wpPluginsListTableNoItems.php | Adds tests for WP_Plugins_List_Table::no_items(). |
Review effort: Balanced
lancewillett
left a comment
There was a problem hiding this comment.
The unit-tests audit found no landing blockers. The affected classes passed individually and together across three randomized seeds on single-site and multisite, with no failures or skips. PHPCS passed. CI is still running; please wait for it before landing.
AI review · gpt-6
Test `WP_Plugins_List_Table::no_items()` for empty views, search terms, escaped output, directory links, installation permissions, and multisite behavior. Developed in: #14585 Props huzaifaalmesbah. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64668 602fd350-edb4-49c9-b593-d223f7449a82
|
PR #14585 landed in https://core.trac.wordpress.org/changeset/64668 |
Test `WP_Plugins_List_Table::no_items()` for empty views, search terms, escaped output, directory links, installation permissions, and multisite behavior. Developed in: WordPress/wordpress-develop#14585 Props huzaifaalmesbah. See #65819. Built from https://develop.svn.wordpress.org/trunk@64668 git-svn-id: http://core.svn.wordpress.org/trunk@63818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Description
Adds tests for
WP_Plugins_List_Table::no_items(), the message shown on the Plugins screen when a view or search has no plugins. The method had no tests.The tests set the
$pluginsglobal and the search request, and restore both, along with the request URI that the list table changes for a search. They cover:'0'search term not being treated as a search;Removing or changing each branch of the method makes at least one test fail on single site or multisite.
This is a test-only change; no production code is modified.
Testing Instructions
npm run test:php -- --filter Tests_Admin_wpPluginsListTableNoItemsnpm run test:php -- --filter Tests_Admin_wpPluginsListTableNoItems -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Admin_wpPluginsListTableNoItems --order-by=randomnpm run test:php -- --group pluginsnode ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpcs tests/phpunit/tests/admin/wpPluginsListTableNoItems.phpTrac ticket: https://core.trac.wordpress.org/ticket/65819
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Brainstorming edge-case scenarios and drafting test boilerplate; test architecture, assertions, and local PHPUnit verification were written and validated by me.