Repository navigation
Tests: Add unit test coverage for the plugin sections of WP_Debug_Data - #14583
huzaifaalmesbah wants to merge 1 commit 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. |
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in this test-only change; tests were not executed.
No open issues 🎉
What changed in this PR
Adds unit coverage for the plugin sections of Site Health Info and copied debug data, without changing production code.
Changes:
- Tests plugin metadata formatting, active/inactive grouping, and available updates.
- Covers auto-update settings, filters, and filter arguments.
- Adds fixture setup and cleanup for plugin files, caches, and settings.
| File | Description |
|---|---|
| tests/phpunit/tests/admin/wpDebugDataPlugins.php | Adds tests for must-use and regular plugin debug data. |
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.
Optional follow-up: also assert the literal copied debug text version: 1.0, author: Jane, Custom in the filtered auto-update-string case, so the custom status is protected in both outputs.
AI review · gpt-6
|
PR #14583 landed in https://core.trac.wordpress.org/changeset/64665 |
Test the plugin sections produced by `WP_Debug_Data`, including must-use plugins, active and inactive plugins, available updates, auto-update settings, and filtered debug strings. Developed in: #14583 Props huzaifaalmesbah. See #65819. git-svn-id: https://develop.svn.wordpress.org/trunk@64665 602fd350-edb4-49c9-b593-d223f7449a82
Test the plugin sections produced by `WP_Debug_Data`, including must-use plugins, active and inactive plugins, available updates, auto-update settings, and filtered debug strings. Developed in: WordPress/wordpress-develop#14583 Props huzaifaalmesbah. See #65819. Built from https://develop.svn.wordpress.org/trunk@64665 git-svn-id: http://core.svn.wordpress.org/trunk@63815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Description
Adds tests for
WP_Debug_Data::get_wp_mu_plugins()andWP_Debug_Data::get_wp_plugins_raw_data(), which build the "Must Use Plugins", "Active Plugins" and "Inactive Plugins" sections of the Site Health Info screen and the copied debug data. Neither method had tests.The tests move the must-use plugins directory aside and create must-use plugins in it, prime the plugins cache with test plugins, and set the
update_pluginstransient and the auto-update settings. They cover:auto_update_pluginssetting, and theauto_update_pluginfilter forcing it on or off;plugin_auto_update_debug_stringfilter receiving its arguments and changing the status string.Removing or changing each branch of the two methods makes at least one test fail.
This is a test-only change; no production code is modified.
Testing Instructions
npm run test:php -- --filter Tests_Admin_wpDebugDataPluginsnpm run test:php -- --filter Tests_Admin_wpDebugDataPlugins -c tests/phpunit/multisite.xmlnpm run test:php -- --filter Tests_Admin_wpDebugDataPlugins --order-by=randomnpm run test:php -- --group site-health,pluginsnode ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpcs tests/phpunit/tests/admin/wpDebugDataPlugins.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.