Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Do not optimise away packages due to a requirement by a locked p…
…ackage that will be uninstalled Fixes #10394
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 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
54 changes: 54 additions & 0 deletions
54
...est/DependencyResolver/Fixtures/poolbuilder/filter-impossible-oackages-only-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,54 @@ | ||
--TEST-- | ||
When filtering packages from the pool that cannot meet the fixed/locked requirements, ensure that the requirements for a package that is not required anywhere is not used to filter, as it will be ultimately be removed. | ||
|
||
--REQUEST-- | ||
{ | ||
"require": { | ||
"first/pkg": "*", | ||
"second/pkg": "1.1.0" | ||
}, | ||
"locked": [ | ||
{"name": "first/pkg", "version": "1.0.0", "require": {"second/pkg": "^1.0"}}, | ||
{"name": "second/pkg", "version": "1.0.0", "require": {"third/pkg": "1.0.0"}}, | ||
{"name": "third/pkg", "version": "1.0.0", "require": {"fourth/pkg": "1.0.0"}}, | ||
{"name": "fourth/pkg", "version": "1.0.0"} | ||
], | ||
"allowList": [ | ||
"first/pkg" | ||
], | ||
"allowTransitiveDeps": true | ||
} | ||
|
||
--FIXED-- | ||
[ | ||
] | ||
|
||
--PACKAGE-REPOS-- | ||
[ | ||
[ | ||
{"name": "first/pkg", "version": "1.0.0", "require": {"second/pkg": "*"}}, | ||
{"name": "second/pkg", "version": "1.0.0", "require": {"third/pkg": "1.0.0"}}, | ||
{"name": "second/pkg", "version": "1.1.0", "require": {"fourth/pkg": "2.0.0"}}, | ||
{"name": "third/pkg", "version": "1.0.0", "require": {"fourth/pkg": "1.0.0"}}, | ||
{"name": "fourth/pkg", "version": "1.0.0"}, | ||
{"name": "fourth/pkg", "version": "2.0.0"} | ||
] | ||
] | ||
|
||
--EXPECT-- | ||
[ | ||
"third/pkg-1.0.0.0 (locked)", | ||
"first/pkg-1.0.0.0", | ||
"second/pkg-1.1.0.0", | ||
"fourth/pkg-1.0.0.0", | ||
"fourth/pkg-2.0.0.0" | ||
] | ||
|
||
--EXPECT-OPTIMIZED-- | ||
[ | ||
"third/pkg-1.0.0.0 (locked)", | ||
"first/pkg-1.0.0.0", | ||
"second/pkg-1.1.0.0", | ||
"fourth/pkg-1.0.0.0", | ||
"fourth/pkg-2.0.0.0" | ||
] |