Add test covering replacer unfixing
parent
f2befc46c9
commit
b7f1550896
|
@ -8,9 +8,9 @@ Partially updating one root requirement with transitive deps fully updates anoth
|
||||||
"root/dep": "*"
|
"root/dep": "*"
|
||||||
},
|
},
|
||||||
"locked": [
|
"locked": [
|
||||||
{"name": "root/update", "version": "1.0.1", "require": {"dep/dep": "1.*"}, "id": 1},
|
{"name": "root/update", "version": "1.0.1", "require": {"dep/dep": "1.*"}},
|
||||||
{"name": "dep/dep", "version": "1.0.2", "require": {"root/dep": "1.*"}, "id": 2},
|
{"name": "dep/dep", "version": "1.0.2", "require": {"root/dep": "1.*"}},
|
||||||
{"name": "root/dep", "version": "1.0.3", "id": 3}
|
{"name": "root/dep", "version": "1.0.3"}
|
||||||
],
|
],
|
||||||
"allowList": [
|
"allowList": [
|
||||||
"root/update"
|
"root/update"
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
--TEST--
|
||||||
|
Fixed packages and replacers get unfixed correctly (refs https://github.com/composer/composer/pull/8942)
|
||||||
|
|
||||||
|
--REQUEST--
|
||||||
|
{
|
||||||
|
"require": {
|
||||||
|
"root/req1": "*",
|
||||||
|
"root/req3": "*"
|
||||||
|
},
|
||||||
|
"locked": [
|
||||||
|
{"name": "root/req1", "version": "1.0.0", "require": {"replacer/pkg": "1.*"}},
|
||||||
|
{"name": "root/req3", "version": "1.0.0", "require": {"replaced/pkg": "1.*", "dep/dep": "2.*"}},
|
||||||
|
{"name": "replacer/pkg", "version": "1.0.0", "replace": {"replaced/pkg": "*"}},
|
||||||
|
{"name": "dep/dep", "version": "2.3.5"}
|
||||||
|
],
|
||||||
|
"allowList": [
|
||||||
|
"root/req1"
|
||||||
|
],
|
||||||
|
"allowTransitiveDeps": true
|
||||||
|
}
|
||||||
|
|
||||||
|
--FIXED--
|
||||||
|
[
|
||||||
|
]
|
||||||
|
|
||||||
|
--PACKAGES--
|
||||||
|
[
|
||||||
|
{"name": "root/req1", "version": "1.0.0", "require": {"replacer/pkg": "1.*"}},
|
||||||
|
{"name": "root/req1", "version": "1.1.0", "require": {"replacer/pkg": "1.*"}},
|
||||||
|
{"name": "root/req3", "version": "1.0.0", "require": {"replaced/pkg": "1.*"}},
|
||||||
|
{"name": "root/req3", "version": "1.1.0", "require": {"replaced/pkg": "1.*"}},
|
||||||
|
{"name": "replacer/pkg", "version": "1.0.0", "replace": {"replaced/pkg": "*"}},
|
||||||
|
{"name": "replacer/pkg", "version": "1.1.0", "replace": {"replaced/pkg": "*"}},
|
||||||
|
{"name": "replaced/pkg", "version": "1.2.3"},
|
||||||
|
{"name": "replaced/pkg", "version": "1.2.4"},
|
||||||
|
{"name": "dep/dep", "version": "2.3.5"},
|
||||||
|
{"name": "dep/dep", "version": "2.3.6"}
|
||||||
|
]
|
||||||
|
|
||||||
|
--EXPECT--
|
||||||
|
[
|
||||||
|
"root/req3-1.0.0.0 (locked)",
|
||||||
|
"dep/dep-2.3.5.0 (locked)",
|
||||||
|
"root/req1-1.0.0.0",
|
||||||
|
"root/req1-1.1.0.0",
|
||||||
|
"replacer/pkg-1.0.0.0",
|
||||||
|
"replacer/pkg-1.1.0.0",
|
||||||
|
"replaced/pkg-1.2.3.0",
|
||||||
|
"replaced/pkg-1.2.4.0"
|
||||||
|
]
|
|
@ -113,11 +113,16 @@ class PoolBuilderTest extends TestCase
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($package instanceof AliasPackage && $id = array_search($package->getAliasOf(), $packageIds, true)) {
|
$suffix = '';
|
||||||
return (string) $package->getName().'-'.$package->getVersion() .' alias of '.$id;
|
if ($package->getRepository() instanceof LockArrayRepository) {
|
||||||
|
$suffix = ' (locked)';
|
||||||
}
|
}
|
||||||
|
|
||||||
return (string) $package;
|
if ($package instanceof AliasPackage && $id = array_search($package->getAliasOf(), $packageIds, true)) {
|
||||||
|
return (string) $package->getName().'-'.$package->getVersion() .' alias of '.$id . $suffix;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (string) $package . $suffix;
|
||||||
}, $result);
|
}, $result);
|
||||||
|
|
||||||
$this->assertSame($expect, $result);
|
$this->assertSame($expect, $result);
|
||||||
|
|
Loading…
Reference in New Issue