Support PHPUnit 12 by W0rma · Pull Request #6826 · Codeception/Codeception · GitHub
Skip to content

Support PHPUnit 12 - #6826

Merged
TavoNiievez merged 1 commit into
Codeception:mainfrom
W0rma:phpunit12
Feb 16, 2025
Merged

TavoNiievez merged 1 commit into
Codeception:mainfrom
W0rma:phpunit12

Conversation

@W0rma

@W0rma W0rma commented Feb 11, 2025

Copy link
Copy Markdown
Contributor

The only breaking change which needs to be considered seems to be sebastianbergmann/php-code-coverage@eca5d61

Some other codeception packages need to support PHPUnit 12 before this PR can be merged.
I have already prepared PRs for all of them:

@W0rma
W0rma force-pushed the phpunit12 branch 4 times, most recently from 5a8cb67 to 0f5c4a4 Compare February 14, 2025 07:13
@W0rma
W0rma marked this pull request as ready for review February 14, 2025 07:40
@W0rma

W0rma commented Feb 14, 2025

Copy link
Copy Markdown
Contributor Author

@TavoNiievez
TavoNiievez merged commit 69b7545 into Codeception:main Feb 16, 2025
@W0rma
W0rma deleted the phpunit12 branch February 17, 2025 04:03
@llaville

Copy link
Copy Markdown
Contributor

Codeception 5.3.2 that install PHPUnit 12.x are not fully compatible.

Reason: Typed class constants are only allowed since PHP 8.3

See https://github.com/sebastianbergmann/phpunit/blob/12.3/src/TextUI/Configuration/Cli/Builder.php#L37

For example, on my project https://github.com/llaville/sarif-php-sdk/tree/2.3 that recently support both PHPUnit natively and Codeception v5, with packages installed

codeception/codeception            5.3.2   BDD-style testing framework
phpunit/phpunit                    12.3.10 The PHP Unit Testing framework.

I got

Codeception PHP Testing Framework v5.3.2 https://stand-with-ukraine.pp.ua

Parse error: syntax error, unexpected identifier "LONG_OPTIONS", expecting "=" in /shared/backups/bartlett/sarif-php-sdk/vendor-bin/codeception/vendor/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php on line 37

Remember that PHPUnit 12 is for PHP >= 8.3 (see https://phpunit.de/supported-versions.html)

And Codeception v5.3 is for PHP >= 8.2

@llaville

Copy link
Copy Markdown
Contributor

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.

4 participants