Skip to content

Allow PHPUnit 13 - #12

Merged
DEVizzent merged 4 commits into
mainfrom
feature/phpunit-13
Nov 6, 2026
Merged

DEVizzent merged 4 commits into
mainfrom
feature/phpunit-13

Conversation

@DEVizzent

Copy link
Copy Markdown
Owner

Summary

  • Add ^13.0 to the phpunit/phpunit constraint. PHPUnit 13.4.6 is the latest stable release; 14 only exists as dev-main (14.0-dev) and Codeception 5.3.7 caps at ^13.0, so it is not included.
  • Remove --ignore-platform-reqs from the PHP 8.3 and 8.4 CI jobs. PHPUnit 13 requires PHP >= 8.4.1, so with the flag the PHP 8.3 job would install a version it cannot run.

No changes in src/: the PHPUnit classes it uses (Assert, AssertionFailedError, ExpectationFailedException) work with PHPUnit 13.

Resolved versions

PHP PHPUnit Codeception
8.2 11.5.57 5.3.7
8.3 12.5.43 5.3.7
8.4.1 13.4.6 5.3.7
8.5 13.4.6 5.3.7

Codeception supports PHPUnit 13 from 5.3.5. Resolution only for 8.2, 8.3 and 8.5; tests were run on 8.4.

Test plan

Run locally on Windows with PHP 8.4.27 and MockServer 5.15.0 (jar, not the Docker image):

  • PHPUnit 13.4.6: 11 of 13 tests pass.
  • PHPUnit 13.0.0 + Codeception 5.3.5: same result.
  • main on PHPUnit 12.5.43: the same 2 tests fail, so they are not caused by this change.
  • The 2 failures come from PHP_EOL being \r\n on Windows. With \n in a temporary copy, all 13 pass on PHPUnit 13.4.6.
  • PHPStan passes. PHPCS passes, excluding the line-ending sniff (CRLF checkout on Windows).
  • CI on Linux. The PHP 8.4 job is still experimental, so a failure there won't fail the workflow.

Notes (not addressed here)

  • PHPUnit 14 will remove executionOrder="depends", and phpunit.xml uses a deprecated schema. Migrating it would conflict with the older PHPUnit versions still allowed.
  • 11 tests trigger a PHPUnit notice for using createMock() without expectations.

🤖 Generated with Claude Code

DEVizzent and others added 4 commits November 6, 2026 10:03
Add ^13.0 to the phpunit/phpunit constraint. PHPUnit 13 is the latest
stable major; Codeception supports it from 5.3.5.

PHPUnit 13 requires PHP >= 8.4.1, so drop --ignore-platform-reqs from the
PHP 8.3 and 8.4 CI jobs. Otherwise PHP 8.3 would install a PHPUnit version
it cannot run. Without the flag, Composer resolves 12.5 there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compare the failure message against "\n" instead of PHP_EOL, because
PHPUnit always joins the message with "\n". This fixes 2 failures on
Windows.

Use createStub() for ModuleContainer, which has no expectations. This
removes the PHPUnit notices reported since PHPUnit 12.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the literal line break added in the previous commit with an
escaped newline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MockServer 9 reports a request found more times than expected as "Request
found 1 time but should have been found exactly 0 times". The test only
accepted the older "Request not found exactly 0 times" wording, so it failed
in CI, where the unpinned mockserver/mockserver image now resolves to 9.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DEVizzent
DEVizzent merged commit 200b462 into main Nov 6, 2026
12 checks passed
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