29: Cover the branches a regression could take silently - #43
Open
nikolaystrikhar wants to merge 1 commit into
Open
29: Cover the branches a regression could take silently#43nikolaystrikhar wants to merge 1 commit into
nikolaystrikhar wants to merge 1 commit into
Conversation
Detector::has_conflict() never walked past a non-conflicting first entry -- every multi-entry case registered the conflicted sub-plugin first, so checking only the first registration passed the file. A host bundling two plugins where the second one's standalone is active got nothing resolved. boot() sets $booted last so a boot that threw can be retried; moving that line to the top broke no test. It binds its own Provider_Interface only when nothing answers to one already; no test bound a double before booting. Loads_Plugin_Functions guards on deactivate_plugins() and deliberately not on is_plugin_active(), which is a common third-party shim -- but both callers require the file in setUp so the guard never ran. Covered now against a throwaway WordPress root, asserting which name the guard asks about first. And the activation record's network scope, which no test reached: there was no switch_to_blog() anywhere in the suite.
nikolaystrikhar
force-pushed
the
29-uncovered-branches
branch
from
August 13, 2026 13:41
ade0f06 to
e400caf
Compare
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.
What: tests for
Conflict\Detector's registration loop,Absorber::boot()'s retry-after-throw and provider seam, thePlugin\Loads_Plugin_Functionsguard, and the activation record's network scope.Usage:
Why this way:
Every multi-entry detector test registered the conflicted sub-plugin first. So checking only the first registration passed the whole file, while a host bundling two plugins where the second standalone is active got nothing resolved and nothing explained.
boot()sets$bootedlast on purpose, so a host that fixes a broken bootstrap and calls again gets a working library rather than a silent no-op. Moving that line to the top of the method broke no test.The load-guard trait's guard never ran. Both callers
require_oncecore'splugin.phpinsetUp()so uopz can stub it, which makesfunction_exists( 'deactivate_plugins' )true before the guard is reached. It is now driven against a throwaway WordPress root, asserting which name the guard asks about — the invariant is that it must not be the shimmable one.The activation record is a network option, and nothing in the suite had ever called
switch_to_blog().