Repository navigation
Conversation
…n_information(). See #66566.
There was a problem hiding this comment.
🟡 Changes recommended
The test handler’s E_WARNING-only mask lets other errors bypass PHPUnit and be captured as output without failing the tests.
1 open issue
What changed in this PR
Adds unit tests for the compatibility notices and footer of install_plugin_information(), extending coverage for ticket #66566 without changing production code.
Changes:
- Covers PHP and WordPress compatibility notices, permission-dependent links, and notice precedence.
- Tests install, activate, and update buttons, plus cases where no button should appear.
- Checks update notice templates and the filesystem credentials dialog.
| File | Description |
|---|---|
tests/phpunit/tests/admin/includes/plugin-install/InstallPluginInformationFooter_Test.php |
Adds rendering helpers and tests for compatibility notices and footer behavior. |
Review effort: Balanced
|
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:
|
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks for covering the compatibility notices and footer actions, @hmbashar! Testing the precedence between WordPress and PHP compatibility notices, as well as the install/update button permission states, is very thorough.
All 97 CI checks pass.
A small suggestion on the error handler in render() (around line 159):
Passing E_ALL instead of E_WARNING to set_error_handler() will allow the wrapper to catch notices and deprecations and delegate them to $previous_handler, ensuring unexpected diagnostics don't slip into output silently.
Nicely done!
AI Review: Gemini 3.8 Flash
|
Thanks for the review, @huzaifaalmesbah. Changed the error handler mask from |

Summary
Part 3 of the tests for
install_plugin_information()(ticket #66566): the notices about the compatibility and the footer with the button. The data and the sections, and the sidebar, are in other pull requests.Testing
Mutation check: 19 changes to this part of the function (the compatibility checks, the capabilities, the types and the links of the notices, the footer, the conditions and the changes of the button, and the dialog) were each caught by a test, on single-site and multisite. Two changes are equivalent: the check of the capabilities in front of the button (a user who cannot do either gets an empty button anyway), and
wp_kses_post()of the button (it does not change this markup).The test for a user who can only update plugins is not run on multisite, where only a super admin can update plugins. The screen sends headers, which PHP refuses because the tests have output already, so the tests ignore that warning only.
Trac ticket: https://core.trac.wordpress.org/ticket/66566
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.