From 17b50157e49b4a18b19c408c1bb085e9053ec520 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 27 Mar 2020 22:46:54 +0100 Subject: [PATCH] Test: composer update new/plg --with-dependencies updates locked transitive deps --- ...ow-list-with-dependencies-require-new.test | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-require-new.test diff --git a/tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-require-new.test b/tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-require-new.test new file mode 100644 index 000000000..24eb95538 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/update-allow-list-with-dependencies-require-new.test @@ -0,0 +1,48 @@ +--TEST-- +Require a new package in the composer.json and updating with its name as an argument and with-dependencies should update locked dependencies as far as possible +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } }, + { "name": "current/pkg", "version": "1.1.0", "require": { "current/dep": "^1.0" } }, + { "name": "current/dep", "version": "1.0.0" }, + { "name": "current/dep", "version": "1.1.0" }, + { "name": "current/dep", "version": "1.2.0" }, + { "name": "new/pkg", "version": "1.0.0", "require": { "current/dep": "^1.1" } }, + { "name": "new/pkg", "version": "1.1.0", "require": { "current/dep": "^1.2" } } + ] + } + ], + "require": { + "current/pkg": "1.*", + "new/pkg": "1.*" + } +} +--INSTALLED-- +[ + { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } }, + { "name": "current/dep", "version": "1.0.0" } +] +--LOCK-- +{ + "packages": [ + { "name": "current/pkg", "version": "1.0.0", "require": { "current/dep": "<1.2.0" } }, + { "name": "current/dep", "version": "1.0.0" } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} +--RUN-- +update new/pkg --with-dependencies +--EXPECT-- +Upgrading current/dep (1.0.0 => 1.1.0) +Installing new/pkg (1.0.0)