Skip to content

11. Give every assertion something it can fail on - #72

Open
nikolaystrikhar wants to merge 2 commits into
47-lifecycle-actionsfrom
58-assertions-that-cannot-pass-wrongly
Open

11. Give every assertion something it can fail on#72
nikolaystrikhar wants to merge 2 commits into
47-lifecycle-actionsfrom
58-assertions-that-cannot-pass-wrongly

Conversation

@nikolaystrikhar

Copy link
Copy Markdown
Contributor

What: closes the assertions in the notice-store, writer, provider and redirector suites that pass whether or not the behaviour they name still exists, and re-arms WordPress's unexpected-_doing_it_wrong() check that WithIncorrectUsage was giving away.

Usage: composer test:unit now runs the singlesite leg and then the multisite one, which is where deactivate_plugins(), manage_network_plugins and the site-option queue actually differ.

Why this way:

An absence needs a control. assertNotContains( $option, wp_load_alloptions() ) passes over an empty bundle and goes on passing for ever, so both queue tests now find an option written with autoload on first, out of a bundle re-read from the database.

The \z anchor is unreachable through an ordinary request URI, so the parse is stubbed. PHP's parse_url() rewrites a path's control bytes to _, which refuses edit.php\n for a different reason and hides the anchor entirely; that is a parser detail, not a promise, and \z is what holds if it changes.

The expectation is what the caller declared, not whatever arrived. Registering every report as expected disarmed WPTestCase on the first one a test wanted, so only this library's own reports are registered now.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: f3c68b9c-84cf-44c6-831d-150372c62e96

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant