15B: Scenario suite — every conflict policy, end to end - #29
Open
nikolaystrikhar wants to merge 1 commit into
Open
15B: Scenario suite — every conflict policy, end to end#29nikolaystrikhar wants to merge 1 commit into
nikolaystrikhar wants to merge 1 commit into
Conversation
Seven scenarios that put a real basename into the real active_plugins option and let core's own deactivate_plugins() be what turns it off, so what is asserted is the option WordPress actually holds rather than a stub's recollection of being called. DEACTIVATE deactivates, queues the merge notice and redirects to an asserted destination; NOTICE_ONLY talks without acting; DEFER stands aside with the standalone's own guard constant already defined, which is the state wp-settings.php really leaves the request in. Two of them run a second request, because that is the only way to cover what this library is for: the merge takes one request to resolve and the next one to load. The second request is also where a redirect loop would show, and it is asserted not to halt rather than described as not looping. The capability gate gets a scenario of its own, from both sides. A subscriber resolves nothing and consumes nothing -- the standalone is still there to detect on the next request, from someone who can act on it, which is the half that would pass just as well if the gate had eaten the notice. The reactivation scenario drives the wp_admin_notice_markup filter through core's own dispatch rather than calling the rewriter, because the admin-only add_filter() is half of what has to work: a filter that never wired leaves core's useless sentence on the one screen least able to afford it. Each case is written up in tests/README with a mermaid diagram of its flow, including the policy branch the conflict step takes and the order the two gates are asked in.
Closed
nikolaystrikhar
force-pushed
the
15A-scenario-load
branch
from
August 13, 2026 11:16
0fd6b74 to
61e8c72
Compare
nikolaystrikhar
force-pushed
the
15B-scenario-conflict
branch
from
August 13, 2026 11:16
0013b7e to
6a7022b
Compare
nikolaystrikhar
force-pushed
the
15A-scenario-load
branch
from
August 13, 2026 11:17
61e8c72 to
a88768b
Compare
nikolaystrikhar
force-pushed
the
15B-scenario-conflict
branch
from
August 13, 2026 11:17
6a7022b to
30b454d
Compare
nikolaystrikhar
force-pushed
the
15A-scenario-load
branch
from
August 13, 2026 11:35
a88768b to
c332206
Compare
nikolaystrikhar
force-pushed
the
15B-scenario-conflict
branch
from
August 13, 2026 11:35
30b454d to
fe25fdd
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: seven scenarios that put a real basename into the real
active_pluginsoption and drive the conflict step atplugins_loadedpriority 5 through every branch it has — DEACTIVATE, NOTICE_ONLY, DEFER, the capability gate, the merge notice rendering and clearing onall_admin_notices, the request after a deactivation, and the re-activation screen through core's ownwp_admin_notice_markupdispatch.Usage: a policy scenario, asserting what WordPress holds afterwards rather than what a stub remembers.
Why this way:
Core's own
deactivate_plugins()does the deactivating. Nothing here doubles the plugin state, so what is asserted is the option WordPress really holds rather than a stub's recollection of having been called — which is the only way the network-aware branch and the silent-deactivation argument get exercised at all.Two of them run a second request. That is the only way to cover what this library is for: a merge takes one request to resolve and the next one to load. The second request is also where a redirect loop would show, and it is asserted not to halt rather than described as not looping.
The capability gate gets a scenario from both sides. A subscriber resolves nothing and consumes nothing — the standalone is still there to detect on the next request, from someone who can act on it. Without that second half the test would pass just as well if the gate had quietly eaten the notice.
The destination is asserted, not merely the redirect.
Conflict\Redirectorreads the current request URI, so the scenario pins$_SERVER['REQUEST_URI']in setUp and restores it in tearDown. Left to whatever the previous test wrote, the assertion that the user lands onplugins.phpwas right by accident.The re-activation screen goes through core's filter dispatch, not through
Conflict\Rewriter. The admin-onlyadd_filter()is half of what has to work: a filter that never wired leaves core's "triggered a fatal error" — true, and useless — on the one screen least able to afford it.