Skip to content

Repair wp/5.9 branch Actions: Pin phpunit/phpunit to a PHP 5.6/7.0-compatible release - #619

Closed
desrosj wants to merge 1 commit into
fix-actions-5.9/fix-setup-teardown-polyfillsfrom
fix-actions-5.9/fix-phpunit-dev-dependency-floor
Closed

desrosj wants to merge 1 commit into
fix-actions-5.9/fix-setup-teardown-polyfillsfrom
fix-actions-5.9/fix-phpunit-dev-dependency-floor

Conversation

@desrosj

@desrosj desrosj commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

What?

  • Lowers the phpunit/phpunit dev dependency from ^8.5 to ^5.7 (resolves to 5.7.27), so the PHP 5.6 unit test jobs can load the plugin's Composer autoloader.
  • Changes config.platform.php from 8.1 to 5.6.20, and ignores four Composer advisories, so that version can resolve.
  • Regenerates composer.lock with composer update phpunit/phpunit --with-all-dependencies.

Why?

Both PHP 5.6 jobs fail before any test runs:

Parse error: syntax error, unexpected ':', expecting ';' or '{' in .../vendor/phpunit/phpunit/src/Runner/Version.php on line 34

wp-phpunit/wp-phpunit calls class_exists( 'PHPUnit\Runner\Version' ), which loads the class from the locked phpunit/phpunit 8.5.21. Its return type declarations don't parse on PHP 5.6. PHPUnit 5.7.27 has no namespaced PHPUnit\Runner\Version, so the check returns false and wp-phpunit falls back to PHPUnit_Runner_Version.

wp/6.0 makes the same change in WordPress#84281. This branch also needs:

How?

Only phpunit/phpunit's dependency tree changes in composer.lock: 22 packages updated, phpunit/phpunit-mock-objects 3.4.4 and symfony/yaml v3.4.47 added, and five phar-io/sebastian/theseer packages removed. wp-phpunit/wp-phpunit 5.9.17, yoast/phpunit-polyfills, composer/installers and the PHPCS packages keep their versions.

The PHP 7.4, 8.0 and 8.1 jobs use the PHPUnit bundled in their Docker image, not the one in vendor.

Testing

  • composer update with Composer 2.10.3 resolves as above, and composer install --no-interaction succeeds.
  • On PHP 5.6 and 7.0, every file in vendor/composer/autoload_files.php and PHPUnit's Runner/Version.php passes php -l. class_exists( 'PHPUnit\Runner\Version' ) returns false, and PHPUnit_Runner_Version::id() returns 5.7.27.

Use of AI Tools

This PR was created by Claude Code under my supervision. All code should be treated as AI-produced and not yet reviewed by a human until this PR is marked Ready for Review.

🤖 Generated with Claude Code

@desrosj
desrosj added this pull request to stack #616 October 6, 2026 13:53
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

🤖 PR meta 🤖

🏷️ Labels

This pull request needs exactly one label indicating its type, and has 0.

  • Required: any label starting with [Type].
  • Found: none.

Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you.

@desrosj
desrosj force-pushed the fix-actions-5.9/fix-phpunit-dev-dependency-floor branch from 78eeca5 to 25ccdcc Compare October 6, 2026 17:49
@desrosj
desrosj removed this pull request from stack #616 October 6, 2026 18:27
@desrosj
desrosj added this pull request to stack #636 October 6, 2026 18:28
@desrosj
desrosj removed this pull request from stack #636 October 7, 2026 00:58
@desrosj
desrosj added this pull request to stack #643 October 7, 2026 00:59
@desrosj
desrosj removed this pull request from stack #643 October 7, 2026 18:02
@desrosj
desrosj changed the base branch from fix-actions-5.9/fix-setup-teardown-polyfills to wp/5.9 October 7, 2026 18:02
@desrosj
desrosj force-pushed the fix-actions-5.9/fix-phpunit-dev-dependency-floor branch from 25ccdcc to 5f65e08 Compare October 7, 2026 18:04
@desrosj
desrosj changed the base branch from wp/5.9 to fix-actions-5.9/fix-setup-teardown-polyfills October 7, 2026 18:06
@desrosj
desrosj added this pull request to stack #668 October 7, 2026 18:06
@desrosj
desrosj force-pushed the fix-actions-5.9/fix-phpunit-dev-dependency-floor branch from 5f65e08 to 2b90e73 Compare October 8, 2026 18:17
@desrosj
desrosj removed this pull request from stack #668 October 8, 2026 19:35
@desrosj
desrosj force-pushed the fix-actions-5.9/fix-phpunit-dev-dependency-floor branch from 2b90e73 to 206c61a Compare October 8, 2026 19:35
@desrosj
desrosj added this pull request to stack #695 October 8, 2026 19:35
@desrosj
desrosj marked this pull request as ready for review October 9, 2026 16:38
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: desrosj <desrosj@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@desrosj

desrosj commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Moved to WordPress#84415.

@desrosj desrosj closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant