Skip to content

Comments

Update how we run PHPUnit#440

Open
dkotter wants to merge 12 commits intodevelopfrom
update/phpunit-workflow
Open

Update how we run PHPUnit#440
dkotter wants to merge 12 commits intodevelopfrom
update/phpunit-workflow

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Feb 18, 2026

Description of the Change

Our PHPUnit workflow has started to fail and in investigating that, seems GitHub has updated their default version of Docker that is installed in their runners and that is conflicting with the tool we use to run our tests. That tool hasn't been updated since June 2024 so I'm not confident they'll push out a fix.

Also, there's a better way to run PHPUnit tests now that didn't exist/we didn't know about when we set this up (using wp-env) so this is a good opportunity to clean up that setup.

The following updates are made:

  • We update our GitHub Action workflow to use the wp-env environment to run our PHPUnit tests (and run those on a wider matrix)
  • Update our various config and bootstrap files as needed
  • Fixes a few PHP 8.4 issues

Note most of this was copied from the approach we took on ClassifAI.

How to test the Change

Ensure the PHPUnit GitHub Action runs and passes on this PR

Changelog Entry

Fixed - PHP 8.4 deprecation warnings
Developer - Update our PHPUnit workflow

Credits

Props @dkotter

Checklist:

@dkotter dkotter added this to the 2.3.0 milestone Feb 18, 2026
@dkotter dkotter self-assigned this Feb 18, 2026
@dkotter dkotter requested a review from jeffpaul as a code owner February 18, 2026 17:48
@github-actions github-actions bot added the needs:code-review This requires code review. label Feb 18, 2026
jeffpaul
jeffpaul previously approved these changes Feb 18, 2026
Copy link
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Updated checks pass, looks fine to me

"require-dev": {
"10up/phpcs-composer": "dev-master",
"yoast/phpunit-polyfills": "^1.0.3"
"phpunit/phpunit": "^8.5|^9.6",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@peterwilsoncc I know I removed this on ClassifAI but in testing here, it was installing an older version of PHPUnit that relied on dependencies that weren't compatible with PHP 8.2+. Adding this line forced a newer version of PHPUnit to be installed that fixed that but let me know if there's a better approach here

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

Labels

needs:code-review This requires code review.

Projects

Status: Code Review

Development

Successfully merging this pull request may close these issues.

2 participants