Skip to content

Improve PHPUnit test infrastructure#588

Open
obenland wants to merge 2 commits intoWordPress:trunkfrom
obenland:add/test-infrastructure
Open

Improve PHPUnit test infrastructure#588
obenland wants to merge 2 commits intoWordPress:trunkfrom
obenland:add/test-infrastructure

Conversation

@obenland
Copy link
Copy Markdown
Member

@obenland obenland commented Apr 2, 2026

Summary

Test plan

  • Run composer install — confirms lock file installs correctly
  • Run cd environments && npm run plugins:test — confirms the test script works

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 2, 2026 19:45
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@obenland
Copy link
Copy Markdown
Member Author

obenland commented Apr 2, 2026

@dd32 Heads up in case you have any feedback on this.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve local PHPUnit testing ergonomics and reproducibility for the Plugin Directory project by adding a dedicated npm test script, adding Yoast PHPUnit Polyfills, committing a composer.lock, and ignoring PHPUnit’s result cache file.

Changes:

  • Add plugins:test npm script to run Plugin Directory PHPUnit tests via wp-env.
  • Add yoast/phpunit-polyfills to composer.json and commit composer.lock for reproducible dev installs.
  • Ignore .phpunit.result.cache in Git.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
environments/package.json Adds a plugins:test script intended to run PHPUnit inside the wp-env environment.
composer.json Adds Yoast PHPUnit Polyfills as a dev dependency.
composer.lock New lockfile pinning dev dependency graph (including PHPUnit).
.gitignore Ignores PHPUnit result cache file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Add test-specific wp-env config for plugin directory with lifecycle
  script that upgrades PHPUnit to 11 and installs Yoast polyfills
- Use tests-cli container for proper test isolation
- Pin PHPUnit ^11.0 locally to match container version
- Add Yoast PHPUnit Polyfills (^4.0) for cross-version test support
- Add plugins:test and plugins:test:env npm scripts
- Update CI workflow to use test config and tests-cli container
- Add .phpunit.result.cache to .gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants