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.
🟡 Changes recommended
The error-handler wrapper routes notices and deprecations to PHP’s default handler instead of PHPUnit’s handler, allowing tests to pass despite unexpected diagnostics.
1 open issue
What changed in this PR
Adds sidebar-focused unit tests for install_plugin_information() as part of ticket #66566, without changing production code.
Changes:
- Covers plugin details, active installation counts, and conditional links.
- Tests ratings, review counters, contributors, and donation link placement.
- Adds rendering helpers that mock API responses and stop the screen before request termination.
| File | Description |
|---|---|
tests/phpunit/tests/admin/includes/plugin-install/InstallPluginInformationDetails_Test.php |
Adds sidebar tests and supporting fixtures and rendering helpers. |
Review effort: Balanced
huzaifaalmesbah
left a comment
There was a problem hiding this comment.
Thanks for the patch, @hmbashar! Thorough coverage for the plugin details sidebar, active install counts, contributor avatars, and star rating counters.
The pre_http_request mocking for external WordPress.org requests is very neatly done.
Similar to #15748, in render() (around line 170):
Registering set_error_handler() with E_ALL instead of E_WARNING will ensure that non-warning errors (notices, deprecations) aren't caught by PHP's built-in handler and are properly delegated to $previous_handler while still suppressing the expected headers warning.
Solid test coverage overall!
AI Review: Gemini 3.8 Flash
|
Thanks for the review, @huzaifaalmesbah. Changed the error handler mask from |

Summary
Part 2 of the tests for
install_plugin_information()(ticket #66566): the sidebar with the details of the plugin. The data and the sections are in another pull request, and the notices and the button in the footer are in a third one.Testing
Mutation check: 32 changes to this part of the function (each detail and its condition, the active installations, the links, the rating, the counters, the division by zero, the contributors and the donate link) were each caught by a test.
The request to WordPress.org is answered with
pre_http_request, because the API marks a result that theplugins_apifilter returns as external, which hides the link to the page on WordPress.org. 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.