Skip to content

test: integration suite against a real WordPress (harness#109) - #30

Merged
ogorzalka merged 2 commits into
mainfrom
feat/wordpress-integration
Nov 23, 2026
Merged

ogorzalka merged 2 commits into
mainfrom
feat/wordpress-integration

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

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). Emptying uses_context makes 3 tests fail.

A finding that applies to the harness stub too: Pest loads tests/Pest.php even 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 to tests/bootstrap.php, now referenced by phpunit.xml.dist; the unit suite is identical (276 pass). The script composer test:integration and export-ignore for phpunit.integration.xml are 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 harness main and 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 with composer test:integration and 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.

@ogorzalka
ogorzalka merged commit 3c06102 into main Nov 23, 2026
15 checks passed
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