Always install aliases together with their original package
Restores some Composer 1.x behavior like unbound constraints conflicting with default branches unless they are branch aliased. Simplifies conflicts with aliases because packages cannot be installed without their aliases, so we do not need to know which aliases are uninstalled in lock file or installed.json.main
parent
58f358d028
commit
7197278fe9
@ -1,44 +0,0 @@
|
|||||||
--TEST--
|
|
||||||
Test that root package conflict on a branch alias is ignored if the alias is not required for installation.
|
|
||||||
--COMPOSER--
|
|
||||||
{
|
|
||||||
"repositories": [
|
|
||||||
{
|
|
||||||
"type": "package",
|
|
||||||
"package": [
|
|
||||||
{ "name": "some/dep", "version": "1.0.0" },
|
|
||||||
{ "name": "some/dep", "version": "1.1.0" },
|
|
||||||
{ "name": "some/dep", "version": "1.2.0" },
|
|
||||||
{ "name": "some/dep", "version": "dev-main", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} } },
|
|
||||||
{ "name": "some/dep", "version": "1.2.x-dev" }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"require": {
|
|
||||||
"some/dep": "dev-main"
|
|
||||||
},
|
|
||||||
"conflict": {
|
|
||||||
"some/dep": ">=1.3"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
--RUN--
|
|
||||||
update
|
|
||||||
--EXPECT-LOCK--
|
|
||||||
{
|
|
||||||
"packages": [
|
|
||||||
{ "name": "some/dep", "version": "dev-main", "type": "library", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} } }
|
|
||||||
],
|
|
||||||
"packages-dev": [],
|
|
||||||
"aliases": [],
|
|
||||||
"minimum-stability": "stable",
|
|
||||||
"stability-flags": {
|
|
||||||
"some/dep": 20
|
|
||||||
},
|
|
||||||
"prefer-stable": false,
|
|
||||||
"prefer-lowest": false,
|
|
||||||
"platform": [],
|
|
||||||
"platform-dev": []
|
|
||||||
}
|
|
||||||
--EXPECT--
|
|
||||||
Installing some/dep (dev-main)
|
|
||||||
Marking some/dep (1.3.x-dev) as installed, alias of some/dep (dev-main)
|
|
@ -0,0 +1,38 @@
|
|||||||
|
--TEST--
|
||||||
|
Test that a root package conflict with a branch alias leads to an error, even if the branch alias isn't required.
|
||||||
|
--COMPOSER--
|
||||||
|
{
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "package",
|
||||||
|
"package": [
|
||||||
|
{ "name": "some/dep", "version": "1.0.0" },
|
||||||
|
{ "name": "some/dep", "version": "1.1.0" },
|
||||||
|
{ "name": "some/dep", "version": "1.2.0" },
|
||||||
|
{ "name": "some/dep", "version": "dev-main", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} } },
|
||||||
|
{ "name": "some/dep", "version": "1.2.x-dev" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"some/dep": "dev-main"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"some/dep": ">=1.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__ is present at version 1.0.0+no-version-set and cannot be modified by Composer
|
||||||
|
- some/dep 1.3.x-dev is an alias of some/dep dev-main and must be installed with it.
|
||||||
|
- __root__ 1.0.0+no-version-set conflicts with some/dep 1.3.x-dev.
|
||||||
|
- Root composer.json requires some/dep dev-main -> satisfiable by some/dep[dev-main].
|
||||||
|
--EXPECT--
|
@ -0,0 +1,39 @@
|
|||||||
|
--TEST--
|
||||||
|
Test that a conflict against >=5 includes the default branch if it has a branch alias defined.
|
||||||
|
--COMPOSER--
|
||||||
|
{
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "package",
|
||||||
|
"package": [
|
||||||
|
{ "name": "conflicter/pkg", "version": "1.0.0", "conflict": { "victim/pkg": ">=5", "victim/pkg2": ">=5" } },
|
||||||
|
{ "name": "victim/pkg", "version": "dev-master", "default-branch": true },
|
||||||
|
{ "name": "victim/pkg2", "version": "dev-foo" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"conflicter/pkg": "1.0.0",
|
||||||
|
"victim/pkg": "*",
|
||||||
|
"victim/pkg2": "*"
|
||||||
|
},
|
||||||
|
"minimum-stability": "dev"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--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
|
||||||
|
- conflicter/pkg 1.0.0 conflicts with victim/pkg dev-master.
|
||||||
|
- Root composer.json requires conflicter/pkg 1.0.0 -> satisfiable by conflicter/pkg[1.0.0].
|
||||||
|
- Root composer.json requires victim/pkg * -> satisfiable by victim/pkg[dev-master].
|
||||||
|
|
||||||
|
--EXPECT--
|
Loading…
Reference in New Issue