From db0656eab095d6632281a94106e7294a3ad88bc9 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 13 Nov 2020 14:17:10 +0100 Subject: [PATCH] Duplicate partial update unlock but keep old version test with provide keyword --- ...er-dep-if-still-required-with-provide.test | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/partial-update-keeps-older-dep-if-still-required-with-provide.test diff --git a/tests/Composer/Test/Fixtures/installer/partial-update-keeps-older-dep-if-still-required-with-provide.test b/tests/Composer/Test/Fixtures/installer/partial-update-keeps-older-dep-if-still-required-with-provide.test new file mode 100644 index 000000000..4cae3c87c --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/partial-update-keeps-older-dep-if-still-required-with-provide.test @@ -0,0 +1,65 @@ +--TEST-- +Ensure that a partial update of a dependency does not conflict if the only way to proceed is using an old locked version. + +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + {"name": "root/req1", "version": "1.0.0", "require": {"virtual/pkg1": "1.*"}}, + {"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*", "dep/pkg1": "*"}}, + {"name": "dep/pkg1", "version": "1.0.0", "provide": {"virtual/pkg1": "1.0.0"}}, + {"name": "dep/pkg1", "version": "2.0.0"}, + {"name": "dep/pkg2", "version": "1.0.0"}, + {"name": "dep/pkg2", "version": "1.0.1"}, + {"name": "dep/pkg2", "version": "1.2.0", "require": {"virtual/pkg1": "2.*"}} + ] + } + ], + "require": { + "root/req1": "*", + "root/req2": "*" + } +} +--LOCK-- +{ + "packages": [ + {"name": "dep/pkg1", "version": "1.0.0", "type": "library", "provide": {"virtual/pkg1": "1.0.0"}}, + {"name": "dep/pkg2", "version": "1.0.0", "type": "library"}, + {"name": "root/req1", "version": "1.0.0", "require": {"virtual/pkg1": "1.*"}, "type": "library"}, + {"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*", "dep/pkg1": "*"}, "type": "library"} + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} +--RUN-- +update dep/pkg2 --with-dependencies +--EXPECT-LOCK-- +{ + "packages": [ + {"name": "dep/pkg1", "version": "1.0.0", "type": "library", "provide": {"virtual/pkg1": "1.0.0"}}, + {"name": "dep/pkg2", "version": "1.0.1", "type": "library"}, + {"name": "root/req1", "version": "1.0.0", "require": {"virtual/pkg1": "1.*"}, "type": "library"}, + {"name": "root/req2", "version": "1.0.0", "require": {"dep/pkg2": "1.*", "dep/pkg1": "*"}, "type": "library"} + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} +--EXPECT-- +Installing dep/pkg1 (1.0.0) +Installing root/req1 (1.0.0) +Installing dep/pkg2 (1.0.1) +Installing root/req2 (1.0.0)