Repository navigation
test: integration suite against a real WordPress (harness#109) - #30
Merged
Merged
Conversation
added 2 commits
November 23, 2026 09:40
… preview route, editor script)
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.
Part of Pollora/harness#109: a small integration suite against a real WordPress, where Brain Monkey hides what the Block Bindings API, the REST layer and the script registration really do.
5 tests (plus the 4 of the harness stub): the registration in the real Block Bindings API; the rendering of a real paragraph
WP_Block(escaping, a meta not exposed in REST ignored, a draft hidden from the visitor); the REST preview route (401, 403, 200, 400 on validation); the editor script (handles registered, order of the data). Emptyinguses_contextmakes 3 tests fail.A finding that applies to the harness stub too: Pest loads
tests/Pest.phpeven with-c phpunit.integration.xml; here that file loaded the fake WordPress classes, which fails with "Cannot redeclare class WP_Error" as soon as WordPress loads. Those loads moved totests/bootstrap.php, now referenced byphpunit.xml.dist; the unit suite is identical (276 pass). The scriptcomposer test:integrationandexport-ignoreforphpunit.integration.xmlare added.Not turned on yet: the job that runs this suite is an optional input of the harness workflow (
wordpress-integration), which exists on the harnessmainand ships in 0.1.35; this package pins@v0.1.34, so the suite is not run by the CI until the version is raised (a separate commit, ready, does it). Until then it runs locally withcomposer test:integrationand is excluded from the default suite. Not run by the CI yet: the GitHub jobs themselves (service MySQL, cache, PHP 8.3), coverage and mutation (no pcov on the machine). Run locally against MySQL 8.0 and WordPress 7.1.5 (Docker): 5 tests in 5.6 s, green over 3 random seeds. Pint, PHPStan, Rector (dry run),pollora-qa check --fast: green.