1
0
Fork 0

test: Add a test for not unlocking provider automatically

pull/10411/head
Jason Woods 2021-12-31 15:16:19 +00:00
parent a8ed352b31
commit edb2f854ad
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
--TEST--
Do not automatically unlock provider if a package that requires it's provided implementation is updated.
This prevents potential unlocking of many packages where there are many implementors installed.
--REQUEST--
{
"require": {
"provider/pkg": "*",
"root/req": "*"
},
"locked": [
{"name": "root/req", "version": "1.0.0", "require": {"provided/pkg": "1.0.0"}},
{"name": "provider/pkg", "version": "1.0.0", "provide": {"provided/pkg": "1.0.0"}}
],
"allowList": [
"root/req"
],
"allowTransitiveDeps": true
}
--FIXED--
[
]
--PACKAGE-REPOS--
[
[
{"name": "root/req", "version": "1.0.0", "require": {"provided/pkg": "1.0.0"}},
{"name": "root/req", "version": "2.0.0", "require": {"provided/pkg": "2.0.0"}},
{"name": "provider/pkg", "version": "1.0.0", "provide": {"provided/pkg": "1.0.0"}},
{"name": "provider/pkg", "version": "2.0.0", "provide": {"provided/pkg": "2.0.0"}}
]
]
--EXPECT--
[
"provider/pkg-1.0.0.0 (locked)",
"root/req-1.0.0.0",
"root/req-2.0.0.0"
]
--EXPECT-OPTIMIZED--
[
"provider/pkg-1.0.0.0 (locked)",
"root/req-1.0.0.0",
"root/req-2.0.0.0"
]