Repository navigation
Fix test bootstrap on PHP 8.6 - #3193
Open
faisalahammad wants to merge 1 commit into
Open
faisalahammad wants to merge 1 commit into
faisalahammad wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Changes Proposed in this Pull Request
On PHP 8.6,
vendor/bin/phpunitstops before any test runs. The bootstrap turns every error into an exception while the plugin loads, and the WordPress test library callsspl_object_hash(), which is now deprecated:tests/php/bootstrap.php: the handler already skipped deprecations from/vendor/. It now also skips deprecations from files insideWP_TESTS_DIR. Deprecations from plugin code still stop the run, which is how thenamespaceconstant issue in Fix PHP 8.6 deprecation for class constant named namespace #3191 was found.composer.lock: bumpedamphp/ampfrom v2.6.2 to v2.6.5 andamphp/byte-streamfrom v1.8.1 to v1.8.2. These are dev dependencies of Psalm. The old amp prints an implicit-nullable deprecation on PHP 8.4+, and the 16 tests with@runInSeparateProcessread that output as an error.Testing Instructions
bin/install-wp-tests.sh,WP_TESTS_DIRset).trunk, runcomposer installandvendor/bin/phpunit. You get "Error in bootstrap script" and no test runs.composer install, thenvendor/bin/phpunit.namespaceconstant deprecation, which Fix PHP 8.6 deprecation for class constant named namespace #3191 fixes. With Fix PHP 8.6 deprecation for class constant named namespace #3191 and Use is_int() in stats to fix PHP 8.6 deprecation #3192 applied, the full suite passes.vendor/bin/phpuniton PHP 8.2. Expected: same result as ontrunk.Automated: PHP 8.6 with #3191 and #3192 applied gives 1258 tests OK, 3 skipped (Geocode). PHP 8.2 on this branch gives 1257 tests OK, 3 skipped. Psalm runs clean with the new amp, and PHPCS is clean on the bootstrap.
No end-user changes, so no release notes.