-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run unit tests against WordPress 5.9+ #12608
Conversation
.github/workflows/tests-unit-php.yml
Outdated
# Installs a different PHPUnit version depending on the WP/PHP version combo we're testing against. | ||
# | ||
# | WP / PHP | PHPUnit | | ||
# |-----------|---------| | ||
# | 5.7 / 7.4 | 7 | | ||
# | 5.9 / 7.4 | 8 | | ||
# | 5.9 / 7.4 | 9 | | ||
# | * / 8 | 9 | | ||
# | ||
# See https://make.wordpress.org/core/handbook/references/phpunit-compatibility-and-wordpress-versions/ | ||
- name: Update PHPUnit | ||
run: | | ||
if [[ $WP_VERSION == "5.7" && $PHP_VERSION == "7.4" ]]; then | ||
echo "Installing PHPUnit 7.5.x" | ||
composer require --no-interaction --no-scripts phpunit/phpunit:^7.5 --with-dependencies | ||
elif [[ $WP_VERSION == "latest" || $WP_VERSION == "trunk" || $PHP_VERSION == "7.4" ]]; then | ||
echo "Installing latest version of PHPUnit" | ||
composer update --ignore-platform-reqs --no-interaction --no-scripts yoast/phpunit-polyfills --with-dependencies | ||
fi | ||
env: | ||
WP_VERSION: ${{ matrix.wp }} | ||
PHP_VERSION: ${{ matrix.php }} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, with removing this, all tests are running with PHPUnit 8.5 as can be seen here:
We still need the composer update --ignore-platform-reqs --no-interaction --no-scripts yoast/phpunit-polyfills --with-dependencies
line to update to PHPUnit 9.5.
Once we actually bump the minimum PHP version requirement in #12583, we can remove this and update the dependency permanently in composer.json
via composer update
Co-authored-by: Pascal Birchler <pascalb@google.com>
Context
Summary
Relevant Technical Choices
To-do
User-facing changes
Testing Instructions
This PR can be tested by following these steps:
Reviews
Does this PR have a security-related impact?
Does this PR change what data or activity we track or use?
Does this PR have a legal-related impact?
Checklist
Type: XYZ
label to the PRFixes #12573