IBX-12606: Migrated the test suites to PHPUnit 11 - #46
Merged
Merged
Conversation
konradoboza
approved these changes
Sep 17, 2026
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.
Description:
ibexa/core-persistencefrom PHPUnit 9 to PHPUnit 11, part of the DXP 6.0 org-wide PHPUnit 11 wave.phpunit/phpunitrequire-dev^9.0->^11.5.dama/doctrine-test-bundlealready^8.2(unchanged); nomatthiasnoback/*deps in this repo.phpunit.xml.distandphpunit.integration.xmlmigrated to the 11.5 schema:<listeners><listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/></listeners>replaced with<extensions><bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension"/></extensions>; the integration config's DAMA<extension class="...PHPUnitExtension">converted to a second<bootstrap>entry in the same<extensions>block; droppedbeStrictAboutTodoAnnotatedTests/verbose(removed in PHPUnit 10); addedcacheDirectory=".phpunit.cache".PHPUnitSetList::PHPUNIT_100,PHPUNIT_110,ANNOTATIONS_TO_ATTRIBUTES, temp config, deleted after):@covers/@dataProviderdoc-comments ->#[CoversClass]/#[DataProvider]attributes (6 files); 4createMock()->createStub()conversions where the double is only ever used as a constructor/call argument with no->expects()/->method()on it directly (hand-verified per site, all safe). NosetMethods(/withConsecutive(/->at(/assertObjectHasAttribute/getInvocationCountin this repo (confirmed absent by fullrgoversrc/+tests/).#[\PHPUnit\Framework\Attributes\CoversClass(...)]/DataProvider(...)) down to short form with ause PHPUnit\Framework\Attributes\...;import, per house style.tests/bundle/Gateway/ExpressionVisitorTest.php::configureFieldInMetadata():@param array<string> $fields->@param list<string> $fields— PHPUnit 11's realAssert::logicalOr()carries@no-named-arguments, and PHPStan now rejects spreading a possibly-string-keyed array into it (was silently unchecked under PHPUnit 9's stubs).phpstan-baseline.neon: updated one stale entry's expected type fromPHPUnit\Framework\MockObject\MockObjecttoPHPUnit\Framework\MockObject\Stub(consequence of thecreateMock->createStubconversion in the same file); no ignores added.tests/integration/Gateway/ExpressionVisitorTest.php::setUp()built$this->articleExpressionVisitorwith only 5 constructor args (6 required) — a real bug independent of PHPUnit, never caught before because the integration suite can't run locally (see Verification note below) and PHPStan wasn't clean on this repo prior to the dependency refresh in this PR. Added the missing$connectionargument..gitignore: added/.phpunit.cache/(/.phpunit.result.cachewas already present).composer.lock/vendorwere stale from a previous branch checkout (ibexa/core,ibexa/doctrine-schema,ibexa/test-coreall pinned todev-dbal-4-upgrade, gitignored sogit checkoutdoesn't reset them) and blockedcomposer updateoutright with "Root composer.json requires ... found ...[dev-dbal-4-upgrade] but it does not match the constraint." Included those three packages in the samecomposer update ... --with-all-dependenciescall to re-resolve them onto6.0.x-dev; nocomposer.json/composer.lockchanges result from this beyond the intended PHPUnit bump (composer.lockisn't git-tracked in this repo).For QA:
N/A
Documentation:
N/A
Verification
vendor/bin/phpunit -c phpunit.xml.dist --display-phpunit-deprecations: 34 tests, 133 assertions, 0 failures. 27 deprecations, allMockBuilder::getMockForAbstractClass()(allowed for PHPUnit 11, removed without replacement in 12). Before Rector: same 34 tests green, 32 deprecations (27getMockForAbstractClass+ 5 "Metadata found in doc-comment").vendor/bin/phpunit -c phpunit.integration.xml: bootstrap fails withUNIQUE constraint failed: ibexa_content_field.id— this is the documented org-wide IBX-12530 regression inibexa/test-core@38b1f96(DatabaseSchemaHook/SchemaBuilder), reproduced identically on other repos in this wave and orthogonal to this PHPUnit migration. Treated as informational per the wave plan, not a merge gate.vendor/bin/phpstan analyse --no-progress: no errors (one real test-code fix + one baseline type update, both described above; no ignores added).composer check-cs: clean, 0 of 48 files need changes.vendor/bin/rector process --dry-run(repo's ownrector.php, no PHPUnit sets, re-run with--debugto rule out a stale-cache false zero): clean —[OK] Rector is done!; only a pre-existing, unrelated warning about a deprecated skipped rule (SimplifyFormRenderingRector), present before this migration too.