Repository navigation
Conversation
…he strings. See #66559.
hmbashar
marked this pull request as ready for review
November 6, 2026 15:32
|
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:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds tests for the strings,
install()andupgrade()ofPlugin_Upgrader. The callbacks (deactivate_plugin_before_upgrade(),active_before(),active_after(),delete_old_plugin()),check_package()andplugin_info()already have tests, so these tests add the rest of the class, exceptbulk_upgrade().upgrade_strings()andinstall_strings(), and the strings that theupdate-pluginanddowngrade-pluginmodes of the skin change (another mode changes none).install()runs with the package and the plugins directory, does not overwrite files by default, clears the destination to overwrite the package, and adds its hooks (the package check and the cache cleaning) only while it runs, without the cache cleaning when it is not asked for.install()installs the plugin of a package (the zip of the test data), cleans the update information, and announces withupgrader_overwrote_packagethat it overwrote the package, but not without overwriting.upgrade()tells the skin that a plugin without an update is up to date, and does the same when the update is for another plugin.upgrade()runs with the package of the update, removes the old plugin, passes the plugin and its temporary backup (temp_backup) to the hooks, adds the four hooks (deactivation, maintenance mode, deletion of the old plugin, reactivation) only while it runs, and does not clean the cache when it is not asked for.Testing
Mutation check: 36 changes to the strings,
install()andupgrade()(the defaults, the options, the hooks and their removal, the cache, the announcement and the skin calls) were each caught by a test. One is equivalent: removing the explicitwp_clean_plugins_cache()call after a successful installation changes nothing, because theupgrader_process_completehook thatinstall()adds has already cleaned the cache.The tests stop an update with the
upgrader_pre_downloadfilter, and the installation tests copy the zip of the test data first, because the upgrader deletes the package it unpacks. The plugin that is installed is removed after each test.When the download fails,
install()andupgrade()returnnulland not the error, which only the skin gets. The tests do not assert that return value.Trac ticket: https://core.trac.wordpress.org/ticket/66559
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.