--TEST--
Requiring a replaced package in a version, that is not provided by the replacing package, should install correctly (although that is not a very smart idea)
--COMPOSER--
{
    "repositories": [
        {
            "type": "package",
            "package": [
                { "name": "foo/original", "version": "1.0.0", "replace": {"foo/replaced": "1.0.0"} },
                { "name": "foo/replaced", "version": "1.0.0" },
                { "name": "foo/replaced", "version": "2.0.0" }
            ]
        }
    ],
    "require": {
        "foo/original": "1.0.0",
        "foo/replaced": "2.0.0"
    }
}
--RUN--
install
--EXPECT-LOCK--
{
    "packages": [
        { "name": "foo/original", "version": "1.0.0", "replace": {"foo/replaced": "1.0.0"}, "type": "library" },
        { "name": "foo/replaced", "version": "2.0.0", "type": "library" }
    ],
    "packages-dev": [],
    "aliases": [],
    "minimum-stability": "stable",
    "stability-flags": {},
    "prefer-stable": false,
    "prefer-lowest": false,
    "platform": [],
    "platform-dev": []
}
--EXPECT-EXIT-CODE--
0
--EXPECT--
Installing foo/original (1.0.0)
Installing foo/replaced (2.0.0)
