Skip to content

Migrate test infrastructure to wp-test-utils#142

Merged
GaryJones merged 1 commit intodevelopfrom
GaryJones/wp-test-utils
Feb 18, 2026
Merged

Migrate test infrastructure to wp-test-utils#142
GaryJones merged 1 commit intodevelopfrom
GaryJones/wp-test-utils

Conversation

@GaryJones
Copy link
Contributor

Summary

The test bootstrap and configuration still used the old yoast/phpunit-polyfills pattern directly, even though develop already lists yoast/wp-test-utils in composer.json. This PR completes the migration by adopting the wp-test-utils bootstrap pattern from the plugin standards, bringing zoninator in line with the other a8c-plugins.

The bootstrap now conditionally loads WordPress only when the integration testsuite is requested, using WPIntegration\bootstrap_it() for path resolution and environment setup. Tests have been relocated from tests/unit/ to tests/Integration/ to accurately reflect that they are integration tests requiring a full WordPress environment, and the test file has been renamed to follow PSR-4 conventions. The test class is now namespaced under Automattic\Zoninator\Tests\Integration and extends a local TestCase base class that wraps Yoast\WPTestUtils\WPIntegration\TestCase.

Test plan

  • CI integration tests pass (single site)
  • CI integration tests pass (multisite)

Aligns the test infrastructure with the a8c-plugins standard by
using yoast/wp-test-utils bootstrap pattern with conditional
WordPress loading.

The bootstrap now only loads WordPress when the integration
testsuite is requested, and tests are relocated from tests/unit/
to tests/Integration/ to reflect their true nature as integration
tests requiring a full WordPress environment.
@GaryJones GaryJones requested a review from a team as a code owner February 18, 2026 17:55
@GaryJones GaryJones self-assigned this Feb 18, 2026
@GaryJones GaryJones modified the milestones: 1.0.0, Next Feb 18, 2026
@GaryJones GaryJones merged commit ffd4aec into develop Feb 18, 2026
7 checks passed
@GaryJones GaryJones deleted the GaryJones/wp-test-utils branch February 18, 2026 18:36
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

Comments