Fix wp-env to use proper PHP version in test matrix #79
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.
Description
See #78, which addresses a bug in
1.4.0
that should have caused test failures due to a regression. The cause of the issue is that our test matrix PHP version was being used only partially to setup depedencies and run composer:vip-block-data-api/.github/workflows/phpunit.yml
Lines 36 to 40 in 1593b60
but not explicitly passed to
wp-env
:vip-block-data-api/.github/workflows/phpunit.yml
Lines 47 to 50 in 1593b60
This PR addresses these issues:
We now pass the WordPress PHP version via
WP_ENV_PHP_VERSION
.We've added an additional test test with PHP 8.0 and the latest version of WordPress, which may catch similar PHP-related changes in recent versions of WordPress features.
The PHP "latest" option doesn't work with
wp-env
as an option forWP_ENV_PHP_VERSION
:We're passing
8.3
explicitly instead. We'll want to keep this up to date with newer PHP versions, but this is a helpful guide for our highest tested version, which we did not explicitly test before.