From ef42d323b1e98816670cbe201a1922a610d13203 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 27 Mar 2020 23:07:02 +0100 Subject: [PATCH] Test: partial update adding a new dep on a locked package should mark it for update --- ...ist-with-dependencies-new-requirement.test | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-new-requirement.test diff --git a/tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-new-requirement.test b/tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-new-requirement.test new file mode 100644 index 000000000..ff1257498 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-new-requirement.test @@ -0,0 +1,49 @@ +--TEST-- +When partially updating a package to a newer version and the new version has a new requirement for a package we already have installed, mark it for update +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { "name": "root/pkg1", "version": "1.0.0", "require": { "current/dep": "^1.0" } }, + { "name": "root/pkg1", "version": "1.2.0", "require": { "current/dep": "^1.0" } }, + { "name": "current/dep", "version": "1.0.0" }, + { "name": "current/dep", "version": "1.2.0" }, + { "name": "root/pkg2", "version": "1.0.0" }, + { "name": "root/pkg2", "version": "1.2.0", "require": { "current/dep": "^1.2" } } + ] + } + ], + "require": { + "root/pkg1": "1.*", + "root/pkg2": "1.*" + } +} +--INSTALLED-- +[ + { "name": "root/pkg1", "version": "1.0.0", "require": { "current/dep": "^1.0" } }, + { "name": "current/dep", "version": "1.0.0" }, + { "name": "root/pkg2", "version": "1.0.0" } +] +--LOCK-- +{ + "packages": [ + { "name": "root/pkg1", "version": "1.0.0", "require": { "current/dep": "^1.0" } }, + { "name": "current/dep", "version": "1.0.0" }, + { "name": "root/pkg2", "version": "1.0.0" } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} +--RUN-- +update root/pkg2 --with-dependencies +--EXPECT-- +Upgrading current/dep (1.0.0 => 1.2.0) +Upgrading root/pkg2 (1.0.0 => 1.2.0)