2015-02-12 23:37:18 +00:00
--TEST--
2022-12-16 15:48:24 +00:00
The locked version will not get overwritten by an install but fails on invalid packages
2015-02-12 23:37:18 +00:00
--COMPOSER--
{
2023-01-27 15:54:45 +00:00
"version": "1.2.3",
2015-02-12 23:37:18 +00:00
"repositories": [
{
"type": "package",
"package": [
{ "name": "foo/bar", "version": "1.0.0" },
{ "name": "foo/baz", "version": "1.0.0" },
2023-01-27 15:54:45 +00:00
{ "name": "foo/baz", "version": "2.0.0" },
{ "name": "foo/self", "version": "1.2.3" }
2015-02-12 23:37:18 +00:00
]
}
],
"require": {
"foo/bar": "2.0.0",
2023-01-27 15:54:45 +00:00
"foo/baz": "2.0.0",
2023-05-23 21:15:07 +00:00
"foo/self": "self.version",
"foo/provided": "1.0.0",
"foo/provided-wrong-version": "1.0.0",
"foo/root-replaced": "1.0.0",
"foo/root-replaced-wrong-version": "1.0.0"
},
"replace": {
"foo/root-replaced": "^1",
"foo/root-replaced-wrong-version": "^2"
2015-02-12 23:37:18 +00:00
}
}
--LOCK--
{
"packages": [
{ "name": "foo/bar", "version": "1.0.0" },
2023-01-27 15:54:45 +00:00
{ "name": "foo/baz", "version": "2.0.0" },
2023-05-23 21:15:07 +00:00
{
"name": "foo/self",
"version": "1.2.2",
"provide": {
"foo/provided": "^1",
"foo/provided-wrong-version": "^3"
}
}
2015-02-12 23:37:18 +00:00
],
2019-10-29 23:40:36 +00:00
"packages-dev": [],
2015-02-12 23:37:18 +00:00
"aliases": [],
"minimum-stability": "stable",
2024-09-18 14:32:40 +00:00
"stability-flags": {},
2015-02-12 23:37:18 +00:00
"prefer-stable": false,
"prefer-lowest": false
}
--INSTALLED--
[
{ "name": "foo/bar", "version": "1.0.0" },
{ "name": "foo/baz", "version": "1.0.0" }
]
--RUN--
install
2022-12-16 15:48:24 +00:00
--EXPECT-OUTPUT--
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
- Required package "foo/bar" is in the lock file as "1.0.0" but that does not satisfy your constraint "2.0.0".
2023-05-23 21:15:07 +00:00
- Required package "foo/provided-wrong-version" is in the lock file as "provided as ^3 by foo/self 1.2.2" but that does not satisfy your constraint "1.0.0".
- Required package "foo/root-replaced-wrong-version" is in the lock file as "replaced as ^2 by __root__ 1.2.3" but that does not satisfy your constraint "1.0.0".
2022-12-16 15:48:24 +00:00
This usually happens when composer files are incorrectly merged or the composer.json file is manually edited.
Read more about correctly resolving merge conflicts https://getcomposer.org/doc/articles/resolving-merge-conflicts.md
2022-12-21 08:32:50 +00:00
and prefer using the "require" command over editing the composer.json file directly https://getcomposer.org/doc/03-cli.md#require-r
2022-12-16 15:48:24 +00:00
--EXPECT-EXIT-CODE--
4
2015-02-12 23:37:18 +00:00
--EXPECT--