Set WordPress minimum version to 5.9 & update PHPUnit#724
Merged
alecgeatches merged 17 commits intodevelopfrom May 22, 2024
Merged
Set WordPress minimum version to 5.9 & update PHPUnit#724alecgeatches merged 17 commits intodevelopfrom
alecgeatches merged 17 commits intodevelopfrom
Conversation
ingeniumed
approved these changes
May 22, 2024
This file contains hidden or 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-envfor setting up WordPress/testing environment rather thanbin/install-wp-tests.shand 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.phpfile to the latest fromwp scaffold plugin-tests, and also added a small change to enable email-related tests to work.Added a bunch of
protectedand: voidreturn 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.ymlfile 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: