1
0
Fork 0

Add test for root alias presence in lock

pull/8820/head
Jordi Boggiano 2020-04-21 23:01:20 +02:00
parent 1eaa8cd55f
commit bf39fab82d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 97 additions and 1 deletions

View File

@ -0,0 +1,65 @@
--TEST--
Root-defined aliases end up in lock file only if required to solve deps
--COMPOSER--
{
"repositories": [
{
"type": "package",
"package": [
{
"name": "a/aliased", "version": "3.0.2"
},
{
"name": "a/aliased2", "version": "3.0.2"
},
{
"name": "b/requirer", "version": "1.0.0",
"require": { "a/aliased": "^3.0.3", "a/aliased2": "^3.0.0" }
}
]
}
],
"require": {
"a/aliased": "3.0.2 as 3.0.3",
"a/aliased2": "3.0.2 as 3.0.3",
"b/requirer": "*"
}
}
--RUN--
update
--EXPECT-LOCK--
{
"packages": [
{
"name": "a/aliased", "version": "3.0.2",
"type": "library"
},
{
"name": "a/aliased2", "version": "3.0.2",
"type": "library"
},
{
"name": "b/requirer", "version": "1.0.0",
"require": { "a/aliased": "^3.0.3", "a/aliased2": "^3.0.0" },
"type": "library"
}
],
"packages-dev": [],
"aliases": [{
"package": "a/aliased",
"version": "3.0.2.0",
"alias": "3.0.3",
"alias_normalized": "3.0.3.0"
}],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
--EXPECT--
Installing a/aliased2 (3.0.2)
Installing a/aliased (3.0.2)
Marking a/aliased (3.0.3) as installed, alias of a/aliased (3.0.2)
Installing b/requirer (1.0.0)

View File

@ -24,7 +24,38 @@ Aliases of referenced packages work
} }
} }
--RUN-- --RUN--
install update
--EXPECT-LOCK--
{
"packages": [
{
"name": "a/aliased", "version": "dev-master",
"source": { "reference": "abcd", "type": "git", "url": "" },
"type": "library"
},
{
"name": "b/requirer", "version": "1.0.0",
"require": { "a/aliased": "1.0.0" },
"source": { "reference": "1.0.0", "type": "git", "url": "" },
"type": "library"
}
],
"packages-dev": [],
"aliases": [{
"package": "a/aliased",
"version": "dev-master",
"alias": "1.0.0",
"alias_normalized": "1.0.0.0"
}],
"minimum-stability": "stable",
"stability-flags": {
"a/aliased": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
--EXPECT-- --EXPECT--
Installing a/aliased (dev-master abcd) Installing a/aliased (dev-master abcd)
Marking a/aliased (1.0.0) as installed, alias of a/aliased (dev-master abcd) Marking a/aliased (1.0.0) as installed, alias of a/aliased (dev-master abcd)