Opened 6 days ago
Last modified 6 days ago
#66551 new enhancement
Tests: Add unit tests for Plugin_Upgrader_Skin
| Reported by: | hmbashar | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Upgrade/Install | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Plugin_Upgrader_Skin has no test coverage. It sets up the skin of the plugin update screen, and after an update it shows the frame that activates an active plugin again, the links to activate the plugin and to the Plugins page, and the update count script.
This ticket adds tests for the constructor (defaults, arguments, active and network active plugins) and for after() (the frame, the links, who gets the link to activate the plugin, the update_plugin_complete_actions filter and the update count).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Summary
Adds tests for
Plugin_Upgrader_Skin, which had no coverage (0% on Codecov).after()activates an active plugin again in a frame, but not an inactive plugin, a failed update or an update without an installed plugin.after()links to activate the plugin and to the Plugins page, and leaves out the link to activate it after a failure or for a user who cannot activate plugins.update_plugin_complete_actionsfilter receives the links and the plugin file, and no feedback is given when the links are removed.Testing
Mutation check: 18 changes to
class-plugin-upgrader-skin.php(the conditions of the frame and of the links, the filter, the separator, the nonce, the update count) were each caught by a test. The change to the network active check is caught by the multisite run only.The skin collects its feedback in the test, because
show_message()ends all output buffers.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.