-
Notifications
You must be signed in to change notification settings - Fork 130
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
Set WordPress minimum version to 5.9 & update PHPUnit #724
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR makes a handful of changes to PHP unit tests to run with
phpunit ^9.0
:Simplified test matrix to PHP 7.4/WP 5.9 (lowest support), and PHP latest/WP latest.
Use
wp-env
for setting up WordPress/testing environment rather thanbin/install-wp-tests.sh
and friends. I based this on previous work in another repository. This simplifies running tests in GitHub Actions and locally to work the same:Removed
wp-env
-specific configuration frompackage.json
. The docker compose overrides did not appear necessary nor did the rest of the configuration.Updated the tests
bootstrap.php
file to the latest fromwp scaffold plugin-tests
, and also added a small change to enable email-related tests to work.Added a bunch of
protected
and: void
return types to unit test functions (e.g.setUp()
,tearDown()
) to match PHPUnit 9's parent classes.Changed some
->assertContains()
calls to->assertStringContainsString()
when used in a string context.assertContains()
for strings was deprecated in PHPUnit 8.Removed
behat-test.yml
. Apparently this test was added by a bot last year. The referenced workflow checks for abehat.yml
file before running, and I can't find any reference to behat configuration ever in this repository. These were previously causing alerts for "cancelled" checks on each test run: