IBX-12606: Migrated the test suites to PHPUnit 11 - #149
Merged
Merged
Conversation
|
konradoboza
approved these changes
Sep 17, 2026
mikadamczyk
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.



Note
User login providers tests / browser-testsis red on6.0itself at this PR's base commit15f94b1(run 34843258920, same two failing scenarios:Current page "/login" does not match the regex "/Users"). Unrelated to this PR; all other 13 checks pass.Description:
phpunit/phpunit^9.6→^11.5andmatthiasnoback/symfony-dependency-injection-test^5.0→^6.0(symfony/phpunit-bridge^7.4was already satisfied).composer update ... --with-all-dependenciesresolved cleanly, no conflicts.
phpunit.xml(the only config in this repo, covering unit + integration in one file) tothe 11.5 schema:
<coverage>auto-renamed to<source>,cacheDirectory=".phpunit.cache"added.<listeners><listener class="...SymfonyTestsListener"/></listeners>was silently dropped by--migrate-configuration(no warning) and replaced by hand with<extensions><bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension"/></extensions>..phpunit.cache/to.gitignore(alongside the pre-existing.phpunit.result.cacheentry).PHPUnitSetList::PHPUNIT_100,PHPUNIT_110,ANNOTATIONS_TO_ATTRIBUTESvia a temporaryconfig, deleted after use) converted 12
@dataProviderannotations and one@group/@coversNothingpair to attributes (9 files, all providers made
static), rewrote 4->withConsecutive(...)callsites to matcher +
willReturnCallback, and converted 9createMock()calls tocreateStub()where the double is only ever used as a constructor/call argument or a fixed return value with no
expects()/method()configured on it directly — each conversion re-verified by hand, notaccepted blindly.
WithConsecutiveRectoralways attaches->expects($this->exactly(N)), even though the originalUserPermissionsLimitationTypeTest::testValidatePasshad no invocation-count assertion at all(some data-provider sets pass empty arrays, causing the mocked methods to legitimately be called
zero times). Relaxed the matcher back to
self::any()there to match the original, intentionalbehavior; a real test failure otherwise.
return self::throwException(new NotFoundException(...))inside awillReturnCallbackclosure (testValidateError) does not actually throw —self::throwException()builds a stub object meant for
->will()/return slots. Replaced with a realthrowstatement topreserve the original
willReturnOnConsecutiveCallssemantics (first call throws, second returnsa value).
self::any()turned amatch ($matcher->numberOfInvocations())expression non-exhaustive for PHPStan (
AnyInvokedCount's count isn't statically bounded);rewritten as plain
if/elserather than adding an ignore.Ibexa\Tests\Core\Limitation\Base::getUserMock()— a shared test helper shipped byibexa/core(consumed here as a path dependency) — still calls the PHPUnit-11-removed
MockBuilder::setMethods(), confirmed present onibexa/core's ownorigin/6.0(not just astale local checkout). This broke
UserPermissionsLimitationTypeTest::testEvaluate(6 datasets). Fixed entirely within this repo, without touching
ibexa/core: replaced the one call sitewith a plain
$this->createStub(APIUser::class), sinceUserPermissionsLimitationType::evaluate()never reads its
$currentUserargument.ibexa/core's own PHPUnit 11 migration will need theequivalent fix in
Base::getUserMock()for every other 6.0 consumer that relies on it.composer fix-cscleaned up stray docblock/import-ordering artifacts left by the Rector pass (4files);
phpstan-baseline.neonneeded no pruning and no new ignores were added.getMockForAbstractClass()(2 sites,UserPasswordValidatorTest.php) left as-is: deprecated inPHPUnit 11, removed in 12.
For QA:
N/A
Documentation:
N/A