From 976fcd2eb438f21457555d92125b7ef958507d89 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 1 Sep 2020 12:07:12 +0200 Subject: [PATCH] PoolBuilderTest: Add case for multiple repositories and partial update with replace --- .../multi-repo-replace-partial-update.test | 107 ++++++++++++++++++ .../poolbuilder/multi-repo-replace.test | 3 + 2 files changed, 110 insertions(+) create mode 100644 tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace-partial-update.test diff --git a/tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace-partial-update.test b/tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace-partial-update.test new file mode 100644 index 000000000..01eda5215 --- /dev/null +++ b/tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace-partial-update.test @@ -0,0 +1,107 @@ +--TEST-- +Check that replacers from additional repositories are loaded when doing a partial update + +--REQUEST-- +{ + "require": { + "base/package": "^1.0", + "indirect/replacer": "^1.0" + }, + "locked": [ + {"name": "shared/dep", "version": "1.2.0", "id": 1}, + {"name": "indirect/replacer", "version": "1.2.0", "require": {"replacer/package": "^1.2"}, "id": 2}, + {"name": "replacer/package", "version": "1.2.0", "require": {"shared/dep": "^1.1"}, "replace": {"base/package": "1.2.0"}, "id": 3} + ], + "allowList": [ + "indirect/replacer" + ], + "allowTransitiveDepsNoRootRequire": true +} + +--FIXED-- +[ +] + +--PACKAGE-REPOS-- +[ + [ + { + "name": "base/package", + "version": "1.0.0", + "require": { + "shared/dep": "^1.2" + } + }, + { + "name": "shared/dep", + "version": "1.0.0" + }, + { + "name": "shared/dep", + "version": "1.2.0" + } + ], + [ + { + "name": "base/package", + "version": "1.1.0" + }, + { + "name": "shared/dep", + "version": "1.3.0" + } + ], + { + "canonical": false, + "packages": [ + { + "name": "indirect/replacer", + "version": "1.2.0", + "require": { + "replacer/package": "^1.2" + } + }, + { + "name": "replacer/package", + "version": "1.2.0", + "require": { + "shared/dep": "^1.1" + } + }, + { + "name": "shared/dep", + "version": "1.1.0" + } + ] + }, + [ + { + "name": "replacer/package", + "version": "1.0.0", + "require": { + "shared/dep": "^1.0" + }, + "replace": { + "base/package": "1.0.0" + } + }, + { + "name": "indirect/replacer", + "version": "1.0.0", + "require": { + "replacer/package": "^1.0" + } + } + ] +] + +--EXPECT-- +[ + "indirect/replacer-1.2.0.0", + "indirect/replacer-1.0.0.0", + "replacer/package-1.2.0.0", + "replacer/package-1.0.0.0", + "base/package-1.0.0.0", + "shared/dep-1.0.0.0", + "shared/dep-1.2.0.0" +] diff --git a/tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace.test b/tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace.test index 31850dcb6..00c63e4f5 100644 --- a/tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace.test +++ b/tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/multi-repo-replace.test @@ -71,6 +71,9 @@ Check that replacers from additional repositories are loaded "version": "1.0.0", "require": { "shared/dep": "^1.0" + }, + "replace": { + "base/package": "1.2.0" } }, {