Skip to content

Set up a CI pipeline with PHPUnit tests#30

Closed
reimic wants to merge 1 commit intoWordPress:trunkfrom
reimic:phpunit
Closed

Set up a CI pipeline with PHPUnit tests#30
reimic wants to merge 1 commit intoWordPress:trunkfrom
reimic:phpunit

Conversation

@reimic
Copy link
Collaborator

@reimic reimic commented Feb 23, 2024

🚧 Work in progress 🚧

Regarding #27 #25

I've encountered a major problem, when trying to use PHP 8.2, so to move downgrading to a different pr. My goal is to rewrite Pest tests into PHPUnit test, but I can't make them work.

The test are failing with:

PHP Fatal error: Cannot acquire reference to $GLOBALS in D:\blueprints\vendor\phpunit\phpunit\src\Util\Configuration.php on line 543

I've read up on it, and it seems to be connected with the workflow setting up with PHP 8.2. But I am stuck.

@reimic
Copy link
Collaborator Author

reimic commented Feb 23, 2024

Full error log:

Run ./vendor/bin/phpunit
PHP Warning:  Private methods cannot be final as they are never overridden by other classes in /home/runner/work/blueprints/blueprints/vendor/phpunit/phpunit/src/Util/Configuration.php on line 176
PHP Fatal error:  Cannot acquire reference to $GLOBALS in /home/runner/work/blueprints/blueprints/vendor/phpunit/phpunit/src/Util/Configuration.php on line 543
Error: Process completed with exit code 255.

@reimic reimic changed the title Set up a CI pipeline Set up a CI pipeline with PHPUnit tests Feb 23, 2024
@adamziel
Copy link
Collaborator

Oh boy, PHPUnit has its own PHP version compatibility matrix: https://phpunit.de/supported-versions.html

I looked up what does WordPress core do and the composer.json file there seems to list the "yoast/phpunit-polyfills": "^1.1.0" package – perhaps that would help here? If not, you could ask on the #core channel on WP.org slack or #core-test

@adamziel adamziel closed this May 30, 2025
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.

2 participants