Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test checking that a locked replacer with only requires on its re…
…placed name does filter its dependencies, and fix logic accordingly
- Loading branch information
Showing
2 changed files
with
65 additions
and
4 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
60 changes: 60 additions & 0 deletions
60
...t/DependencyResolver/Fixtures/poolbuilder/filter-impossible-packages-locked-replacer.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,60 @@ | ||
--TEST-- | ||
Do not load packages into the pool that cannot meet the fixed/locked requirements, when a loose requirement is encountered during update | ||
(The locked replacer/pkg should restrict dependencies) | ||
|
||
--REQUEST-- | ||
{ | ||
"require": { | ||
"first/pkg": "*", | ||
"second/pkg": "*", | ||
"replacer/dep": "*" | ||
}, | ||
"locked": [ | ||
{"name": "first/pkg", "version": "1.0.0", "require": {"replaced/pkg": "1.0.0"}}, | ||
{"name": "second/pkg", "version": "1.0.0"}, | ||
{"name": "replacer/pkg", "version": "1.0.0", "replace": {"replaced/pkg": "1.0.0"}, "require": {"replacer/dep": "1.*"}}, | ||
{"name": "replacer/dep", "version": "1.0.0"} | ||
], | ||
"allowList": [ | ||
"second/pkg", | ||
"replacer/dep" | ||
], | ||
"allowTransitiveDeps": true | ||
} | ||
|
||
--FIXED-- | ||
[ | ||
] | ||
|
||
--PACKAGE-REPOS-- | ||
[ | ||
[ | ||
{"name": "first/pkg", "version": "1.0.0", "require": {"replaced/pkg": "1.0.0"}}, | ||
{"name": "first/pkg", "version": "1.1.0", "require": {"replaced/pkg": "2.0.0"}}, | ||
{"name": "second/pkg", "version": "1.0.0"}, | ||
{"name": "replacer/pkg", "version": "1.0.0", "replace": {"replaced/pkg": "1.0.0"}, "require": {"replacer/dep": "1.*"}}, | ||
{"name": "replacer/pkg", "version": "1.1.0", "replace": {"replaced/pkg": "2.0.0"}, "require": {"replacer/dep": "1.*"}}, | ||
{"name": "replacer/pkg", "version": "1.2.0", "replace": {"replaced/pkg": "3.0.0"}, "require": {"replacer/dep": "1.*"}}, | ||
{"name": "replacer/dep", "version": "1.0.0"}, | ||
{"name": "replacer/dep", "version": "1.0.1"}, | ||
{"name": "replacer/dep", "version": "2.0.0"} | ||
] | ||
] | ||
|
||
--EXPECT-- | ||
[ | ||
"first/pkg-1.0.0.0 (locked)", | ||
"replacer/pkg-1.0.0.0 (locked)", | ||
"second/pkg-1.0.0.0", | ||
"replacer/dep-1.0.0.0", | ||
"replacer/dep-1.0.1.0", | ||
"replacer/dep-2.0.0.0" | ||
] | ||
|
||
--EXPECT-OPTIMIZED-- | ||
[ | ||
"first/pkg-1.0.0.0 (locked)", | ||
"replacer/pkg-1.0.0.0 (locked)", | ||
"second/pkg-1.0.0.0", | ||
"replacer/dep-1.0.1.0" | ||
] |