Improve error reporting for conflicts/replaces of various kinds, fixes #7254
parent
6c9d9e775c
commit
1d4cdb60d0
@ -0,0 +1,49 @@
|
||||
--TEST--
|
||||
Test that providers provided by a dependent and root package cause a conflict
|
||||
--COMPOSER--
|
||||
{
|
||||
"version": "1.2.3",
|
||||
"repositories": [
|
||||
{
|
||||
"type": "package",
|
||||
"package": [
|
||||
{
|
||||
"name": "provider/pkg",
|
||||
"version": "1.0.0",
|
||||
"provide": { "root-provided/transitive-provided": "2.*", "root-replaced/transitive-provided": "2.*" },
|
||||
"replace": { "root-provided/transitive-replaced": "2.*", "root-replaced/transitive-replaced": "2.*" }
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"provider/pkg": "*"
|
||||
},
|
||||
"provide": {
|
||||
"root-provided/transitive-replaced": "2.*",
|
||||
"root-provided/transitive-provided": "2.*"
|
||||
},
|
||||
"replace": {
|
||||
"root-replaced/transitive-replaced": "2.*",
|
||||
"root-replaced/transitive-provided": "2.*"
|
||||
}
|
||||
}
|
||||
|
||||
--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.2.3 and cannot be modified by Composer
|
||||
- provider/pkg 1.0.0 can not be installed as that would require removing __root__ 1.2.3. They both provide [root-provided/transitive-provided, root-replaced/transitive-provided, root-provided/transitive-replaced, root-replaced/transitive-replaced] and can thus not coexist.
|
||||
- Root composer.json requires provider/pkg * -> satisfiable by provider/pkg[1.0.0].
|
||||
|
||||
--EXPECT--
|
||||
|
@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
Test that providers provided by two dependents cause a conflict
|
||||
--COMPOSER--
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"type": "package",
|
||||
"package": [
|
||||
{
|
||||
"name": "provider/pkg",
|
||||
"version": "1.0.0",
|
||||
"provide": { "third/pkg": "2.*" }
|
||||
},
|
||||
{
|
||||
"name": "replacer/pkg",
|
||||
"version": "1.0.0",
|
||||
"replace": { "third/pkg": "2.*" }
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"provider/pkg": "*",
|
||||
"replacer/pkg": "*"
|
||||
}
|
||||
}
|
||||
|
||||
--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 provider/pkg * -> satisfiable by provider/pkg[1.0.0].
|
||||
- Only one of these can be installed: replacer/pkg 1.0.0, provider/pkg 1.0.0. They both provide third/pkg and can thus not coexist.
|
||||
- Root composer.json requires replacer/pkg * -> satisfiable by replacer/pkg[1.0.0].
|
||||
|
||||
--EXPECT--
|
||||
|
Loading…
Reference in New Issue