Merge pull request #9475 from naderman/fix-alias-alt
Make sure the root aliases always get installed when a package is updatedmain
commit
d6794217d9
@ -0,0 +1,75 @@
|
||||
--TEST--
|
||||
Newly defined root aliases end up in lock file only if the package is updated
|
||||
--COMPOSER--
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "package",
|
||||
"package": [
|
||||
{
|
||||
"name": "a/aliased", "version": "3.0.2"
|
||||
},
|
||||
{
|
||||
"name": "a/aliased2", "version": "3.0.2"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"a/aliased": "3.0.2 as 3.0.3",
|
||||
"a/aliased2": "3.0.2 as 3.0.3"
|
||||
}
|
||||
}
|
||||
--LOCK--
|
||||
{
|
||||
"packages": [
|
||||
{
|
||||
"name": "a/aliased", "version": "3.0.2",
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "a/aliased2", "version": "3.0.2",
|
||||
"type": "library"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
||||
--RUN--
|
||||
update a/aliased
|
||||
--EXPECT-LOCK--
|
||||
{
|
||||
"packages": [
|
||||
{
|
||||
"name": "a/aliased", "version": "3.0.2",
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "a/aliased2", "version": "3.0.2",
|
||||
"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/aliased (3.0.2)
|
||||
Marking a/aliased (3.0.3) as installed, alias of a/aliased (3.0.2)
|
||||
Installing a/aliased2 (3.0.2)
|
@ -0,0 +1,30 @@
|
||||
--TEST--
|
||||
A root alias for a package which cannot be found in an acceptable version does not lead to different error.
|
||||
--COMPOSER--
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "package",
|
||||
"package": [
|
||||
{ "name": "a/aliased", "version": "1.2.3" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"a/aliased": "3.0.2 as 3.0.3"
|
||||
}
|
||||
}
|
||||
--RUN--
|
||||
update
|
||||
--EXPECT-EXIT-CODE--
|
||||
2
|
||||
--EXPECT-OUTPUT--
|
||||
Loading composer repositories with package information
|
||||
Updating dependencies
|
||||
Your requirements could not be resolved to an installable set of packages.
|
||||
|
||||
Problem 1
|
||||
- Root composer.json requires a/aliased 3.0.2 as 3.0.3, found a/aliased[1.2.3] but it does not match the constraint.
|
||||
|
||||
--EXPECT--
|
||||
|
@ -0,0 +1,54 @@
|
||||
--TEST--
|
||||
Newly defined root alias does not get loaded if package is loaded from lock file
|
||||
--COMPOSER--
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "package",
|
||||
"package": [
|
||||
{ "name": "some/dep", "version": "dev-main" },
|
||||
{ "name": "foo/pkg", "version": "1.0.0", "require": {"some/dep": "^1"} }
|
||||
]
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"some/dep": "dev-main as 1.0.0",
|
||||
"foo/pkg": "^1.0"
|
||||
}
|
||||
}
|
||||
--LOCK--
|
||||
{
|
||||
"packages": [
|
||||
{ "name": "some/dep", "version": "dev-main" }
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform-dev": []
|
||||
}
|
||||
--INSTALLED--
|
||||
[
|
||||
{ "name": "some/dep", "version": "dev-main" }
|
||||
]
|
||||
--RUN--
|
||||
update foo/pkg
|
||||
|
||||
--EXPECT-EXIT-CODE--
|
||||
2
|
||||
|
||||
--EXPECT-OUTPUT--
|
||||
Loading composer repositories with package information
|
||||
Updating dependencies
|
||||
Your requirements could not be resolved to an installable set of packages.
|
||||
|
||||
Problem 1
|
||||
- Root composer.json requires foo/pkg ^1.0 -> satisfiable by foo/pkg[1.0.0].
|
||||
- foo/pkg 1.0.0 requires some/dep ^1 -> found some/dep[dev-main] but it does not match the constraint.
|
||||
|
||||
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
|
||||
|
||||
--EXPECT--
|
Loading…
Reference in New Issue