re #209 test: upgrade PHPUnit 11 → 12 and paratest 7.8 → 7.20 - #226
Merged
Conversation
Part of #209. Bumps the test toolchain a major version while keeping the framework's PHP 8.3 floor. PHPUnit 13 and paratest 7.22+ both require PHP >= 8.4.1, so the full "11 -> 13" jump is deferred until a separate decision to drop PHP 8.3; PHPUnit 12 (PHP >= 8.3) + paratest 7.20 (php 8.3||8.4||8.5, phpunit ^12.5||^13) is the ceiling that preserves 8.3 and still moves paratest forward 12 minors. Constraints (phpunit ^11.4 -> ^12.5, paratest ^7 -> ^7.20): - composer.json (require-dev), src/Altair/TestReporter/composer.json, and both bin/altair-generated skeleton composer.json files. - Resolves to phpunit 12.5.29, php-code-coverage 12.5.7, paratest 7.20.0. PHPUnit 12 fixes: - phpunit.xml.dist: drop the redundant <coverage><clover> block. PHPUnit 12 aborts the whole run ("No tests executed") when a coverage report is configured but no driver (pcov/xdebug) is present; CI passes --coverage-clover on the CLI, so the config block was redundant and only broke local runs without a driver. <source> is retained for coverage scope and restrictNotices/restrictWarnings. - 13 "Using with*() on a test stub has no effect and is deprecated": removed the no-op with() argument-matchers from createStub() doubles in 4 Cookie / FormatNegotiator tests (these assert on output, not interaction). - 12 "No expectations were configured for the mock object ... use a test stub instead": converted expectation-less createMock() / getMockBuilder() doubles to createStub() in CycleEntityManagerTest, CycleReadModelRepositoryTest, DispatcherMiddlewareTest, SessionBlockTest (kept the two mocks that do call expects()). Verified on PHPUnit 12.5.29: full suite green (only env-gated Mongo/Redis errors/skips that pass on CI), the test-reporter AltairExtension emits a valid JSON report, and paratest 7.20 runs. cs + stan (level 8) + rector clean. Docs: PHPUnit 11 -> 12 across README, AGENT.md, CLAUDE.md, docs/*, skeleton README, and the test-reporter package reference (constraint + event-system floor).
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.
Part of #209 (does not close it). Upgrades the test toolchain one major version while keeping the framework's PHP 8.3 floor.
Why PHPUnit 12, not 13
Both PHPUnit 13 and paratest 7.22+ require PHP ≥ 8.4.1, so the literal "11 → 13" from #209 would force dropping PHP 8.3 (a breaking change / positioning decision). PHPUnit 12 (PHP ≥ 8.3) + paratest 7.20 (
php 8.3||8.4||8.5,phpunit ^12.5||^13) is the ceiling that preserves 8.3 and still advances paratest 12 minors (7.8.5 → 7.20.0). The full 13 jump is deferred to a separate decision on the 8.3 floor.Resolves to:
phpunit/phpunit 12.5.29,phpunit/php-code-coverage 12.5.7,brianium/paratest 7.20.0.Constraint bumps (
^11.4→^12.5, paratest^7→^7.20)composer.json(require-dev)src/Altair/TestReporter/composer.json(the published reporter package)bin/altair-generated skeletoncomposer.jsonfilesPHPUnit 12 breakages fixed
<coverage>report is configured but pcov/xdebug is absent. Removed the redundant<coverage><clover>block fromphpunit.xml.dist— CI passes--coverage-clover coverage.xmlon the CLI, so the block was duplicative and only broke driverless local runs.<source>is kept (coverage scope +restrictNotices/restrictWarnings).with()argument-matchers fromcreateStub()doubles in 4 Cookie/FormatNegotiator tests (they assert on output, not interaction). Dropped two now-unused imports.createMock()/getMockBuilder()doubles tocreateStub()inCycleEntityManagerTest,CycleReadModelRepositoryTest,DispatcherMiddlewareTest,SessionBlockTest(the two mocks that do callexpects()are left as mocks).Verification
test-reporterAltairExtensionloads on PHPUnit 12 and emits a valid JSON report (result: pass, correct totals) — the Extension + event-subscriber API is unchanged.composer cs+composer stan(level 8, no baseline) +composer rector(whole-tree dry-run) all clean.Docs
PHPUnit 11 → 12 across
README.md,AGENT.md,CLAUDE.md,docs/README.md,docs/packages/{common,middleware,test-reporter}.md, the skeletonREADME.md, and the attributes doc URL (en/11.4/→en/12.5/). Corrected the test-reporter event-system floor to "PHPUnit 11 or earlier".Test plan
vendor/bin/phpunit(PHPUnit 12.5.29) — green except env-gated casesvendor/bin/paratest --no-coverage— greentest-reporterExtension smoke test → valid JSON reportcomposer cs/composer stan/composer rector— clean