forked from composer/composer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request composer#9360 from naderman/pool-builder-unlock-co…
…nsider-all-constraints PoolBuilder: Ensure versions matching locked constraints get loaded
- Loading branch information
Showing
5 changed files
with
213 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
50 changes: 50 additions & 0 deletions
50
...ser/Test/DependencyResolver/Fixtures/poolbuilder/partial-update-unfixing-locked-deps.test
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--TEST-- | ||
Unlocking a package also unlocks its dependencies when transitive deps are true. But version constraints from other | ||
locked packages still need to be taking into account for loading all necessary versions of these transitive deps. | ||
|
||
--REQUEST-- | ||
{ | ||
"require": { | ||
"root/req1": "*", | ||
"root/req2": "*" | ||
}, | ||
"locked": [ | ||
{"name": "root/req1", "version": "1.0.0", "require": {"dep/pkg1": "1.*"}}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*"}}, | ||
{"name": "dep/pkg1", "version": "1.0.0", "author": "old"}, | ||
{"name": "dep/pkg2", "version": "1.0.0"} | ||
], | ||
"allowList": [ | ||
"dep/pkg2" | ||
], | ||
"allowTransitiveDeps": true | ||
} | ||
|
||
--FIXED-- | ||
[ | ||
] | ||
|
||
--PACKAGE-REPOS-- | ||
[ | ||
[ | ||
{"name": "root/req1", "version": "1.0.0", "require": {"dep/pkg1": "1.*"}}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*"}}, | ||
{"name": "dep/pkg1", "version": "1.0.0", "author": "new"}, | ||
{"name": "dep/pkg1", "version": "1.0.1"}, | ||
{"name": "dep/pkg1", "version": "2.0.0"}, | ||
{"name": "dep/pkg1", "version": "3.0.0"}, | ||
{"name": "dep/pkg2", "version": "1.0.0"}, | ||
{"name": "dep/pkg2", "version": "1.2.0", "require": {"dep/pkg1": "2.*"}} | ||
] | ||
] | ||
|
||
--EXPECT-- | ||
[ | ||
"root/req1-1.0.0.0 (locked)", | ||
"root/req2-1.0.0.0 (locked)", | ||
"dep/pkg2-1.0.0.0", | ||
"dep/pkg2-1.2.0.0", | ||
"dep/pkg1-1.0.0.0", | ||
"dep/pkg1-1.0.1.0", | ||
"dep/pkg1-2.0.0.0" | ||
] |
65 changes: 65 additions & 0 deletions
65
...est/Fixtures/installer/partial-update-keeps-older-dep-if-still-required-with-provide.test
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--TEST-- | ||
Ensure that a partial update of a dependency does not conflict if the only way to proceed is using an old locked version. | ||
|
||
--COMPOSER-- | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "package", | ||
"package": [ | ||
{"name": "root/req1", "version": "1.0.0", "require": {"virtual/pkg1": "1.*"}}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*", "dep/pkg1": "*"}}, | ||
{"name": "dep/pkg1", "version": "1.0.0", "provide": {"virtual/pkg1": "1.0.0"}}, | ||
{"name": "dep/pkg1", "version": "2.0.0"}, | ||
{"name": "dep/pkg2", "version": "1.0.0"}, | ||
{"name": "dep/pkg2", "version": "1.0.1"}, | ||
{"name": "dep/pkg2", "version": "1.2.0", "require": {"virtual/pkg1": "2.*"}} | ||
] | ||
} | ||
], | ||
"require": { | ||
"root/req1": "*", | ||
"root/req2": "*" | ||
} | ||
} | ||
--LOCK-- | ||
{ | ||
"packages": [ | ||
{"name": "dep/pkg1", "version": "1.0.0", "type": "library", "provide": {"virtual/pkg1": "1.0.0"}}, | ||
{"name": "dep/pkg2", "version": "1.0.0", "type": "library"}, | ||
{"name": "root/req1", "version": "1.0.0", "require": {"virtual/pkg1": "1.*"}, "type": "library"}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*", "dep/pkg1": "*"}, "type": "library"} | ||
], | ||
"packages-dev": [], | ||
"aliases": [], | ||
"minimum-stability": "stable", | ||
"stability-flags": {}, | ||
"prefer-stable": false, | ||
"prefer-lowest": false, | ||
"platform": [], | ||
"platform-dev": [] | ||
} | ||
--RUN-- | ||
update dep/pkg2 --with-dependencies | ||
--EXPECT-LOCK-- | ||
{ | ||
"packages": [ | ||
{"name": "dep/pkg1", "version": "1.0.0", "type": "library", "provide": {"virtual/pkg1": "1.0.0"}}, | ||
{"name": "dep/pkg2", "version": "1.0.1", "type": "library"}, | ||
{"name": "root/req1", "version": "1.0.0", "require": {"virtual/pkg1": "1.*"}, "type": "library"}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*", "dep/pkg1": "*"}, "type": "library"} | ||
], | ||
"packages-dev": [], | ||
"aliases": [], | ||
"minimum-stability": "stable", | ||
"stability-flags": [], | ||
"prefer-stable": false, | ||
"prefer-lowest": false, | ||
"platform": [], | ||
"platform-dev": [] | ||
} | ||
--EXPECT-- | ||
Installing dep/pkg1 (1.0.0) | ||
Installing root/req1 (1.0.0) | ||
Installing dep/pkg2 (1.0.1) | ||
Installing root/req2 (1.0.0) |
65 changes: 65 additions & 0 deletions
65
tests/Composer/Test/Fixtures/installer/partial-update-keeps-older-dep-if-still-required.test
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--TEST-- | ||
Ensure that a partial update of a dependency does not conflict if the only way to proceed is using an old locked version. | ||
|
||
--COMPOSER-- | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "package", | ||
"package": [ | ||
{"name": "root/req1", "version": "1.0.0", "require": {"dep/pkg1": "1.*"}}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*"}}, | ||
{"name": "dep/pkg1", "version": "1.0.0"}, | ||
{"name": "dep/pkg1", "version": "2.0.0"}, | ||
{"name": "dep/pkg2", "version": "1.0.0"}, | ||
{"name": "dep/pkg2", "version": "1.0.1"}, | ||
{"name": "dep/pkg2", "version": "1.2.0", "require": {"dep/pkg1": "2.*"}} | ||
] | ||
} | ||
], | ||
"require": { | ||
"root/req1": "*", | ||
"root/req2": "*" | ||
} | ||
} | ||
--LOCK-- | ||
{ | ||
"packages": [ | ||
{"name": "dep/pkg1", "version": "1.0.0", "type": "library"}, | ||
{"name": "dep/pkg2", "version": "1.0.1", "type": "library"}, | ||
{"name": "root/req1", "version": "1.0.0", "require": {"dep/pkg1": "1.*"}, "type": "library"}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*"}, "type": "library"} | ||
], | ||
"packages-dev": [], | ||
"aliases": [], | ||
"minimum-stability": "stable", | ||
"stability-flags": {}, | ||
"prefer-stable": false, | ||
"prefer-lowest": false, | ||
"platform": [], | ||
"platform-dev": [] | ||
} | ||
--RUN-- | ||
update dep/pkg2 --with-dependencies | ||
--EXPECT-LOCK-- | ||
{ | ||
"packages": [ | ||
{"name": "dep/pkg1", "version": "1.0.0", "type": "library"}, | ||
{"name": "dep/pkg2", "version": "1.0.1", "type": "library"}, | ||
{"name": "root/req1", "version": "1.0.0", "require": {"dep/pkg1": "1.*"}, "type": "library"}, | ||
{"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*"}, "type": "library"} | ||
], | ||
"packages-dev": [], | ||
"aliases": [], | ||
"minimum-stability": "stable", | ||
"stability-flags": [], | ||
"prefer-stable": false, | ||
"prefer-lowest": false, | ||
"platform": [], | ||
"platform-dev": [] | ||
} | ||
--EXPECT-- | ||
Installing dep/pkg1 (1.0.0) | ||
Installing root/req1 (1.0.0) | ||
Installing dep/pkg2 (1.0.1) | ||
Installing root/req2 (1.0.0) |