[ComposerBased] Pin version-bound tests to a test-specific composer.json instead of the repo root - #513
Merged
Merged
Conversation
TomasVotruba
force-pushed
the
skip-orm-setup-renames-below-3-5
branch
from
August 22, 2026 18:15
2d4ccf0 to
2f9bb53
Compare
…son instead of the repo root
TomasVotruba
force-pushed
the
skip-orm-setup-renames-below-3-5
branch
from
August 22, 2026 18:23
2f9bb53 to
e5bff20
Compare
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.
Problem
ComposerBasedTesthad noprovideComposerJsonFilePath()override, soInstalledPackageResolverfell back to the repo rootcomposer.json(getcwd()) to resolve the version-bound rules. The version-bound fixtures then depended on whateverdoctrine/*happened to be installed locally, and on the root's declared ranges — not on a version the test controls.This surfaced via rectorphp/rector-src#8363: once a distributed package resolves to its lowest declared version, the root
doctrine/orm: ^3.0floor dropped theORMSetup >=3.5renames andversion_bound_orm_setup_renamesbroke.Fix
Pin the version-bound tests to a test-specific
composer.json, via the existingprovideComposerJsonFilePath()hook:{ "require": { "doctrine/orm": "^3.5", "doctrine/dbal": "^4.0" } }Those floors match the APIs the three fixtures target (
doctrine/orm >=3.5for the ORMSetup renames and>=2.9for the annotation-to-attribute pass,doctrine/dbal >=4.0for thegetSchemaManager/isFullfilledByrenames). The rootcomposer.jsonno longer influences the result.This path (
composerJsonFilePathset) resolves versions straight from the declared constraints, so it is independent of rector-src#8363 and green on the current releasedrector-srcas well — verified locally, 3/3.