From ffac8646fc733396885baee2709c7b303bef10be Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 11 Mar 2020 09:34:40 +0100 Subject: [PATCH] Fix tests --- .../installer/circular-dependency2.test | 2 +- .../disjunctive-multi-constraints.test | 14 +-- .../installer/install-from-empty-lock.test | 12 +-- .../install-from-lock-removes-package.test | 28 +++--- .../plugins-are-installed-first.test | 28 +++--- .../installer/replace-priorities.test | 22 ++--- .../update-whitelist-locked-require.test | 42 ++++----- ...telist-patterns-with-all-dependencies.test | 66 +++++++------- ...-whitelist-patterns-with-dependencies.test | 74 +++++++-------- ...elist-patterns-with-root-dependencies.test | 90 +++++++++---------- ...itelist-patterns-without-dependencies.test | 62 ++++++------- .../installer/update-whitelist-patterns.test | 58 ++++++------ .../update-whitelist-removes-unused.test | 32 +++---- .../update-whitelist-with-dependencies.test | 52 +++++------ ...te-whitelist-with-dependency-conflict.test | 48 +++++----- .../Fixtures/installer/update-whitelist.test | 50 +++++------ .../Package/Loader/RootPackageLoaderTest.php | 8 +- 17 files changed, 344 insertions(+), 344 deletions(-) diff --git a/tests/Composer/Test/Fixtures/installer/circular-dependency2.test b/tests/Composer/Test/Fixtures/installer/circular-dependency2.test index 6024c17f2..2a2cc4b0d 100644 --- a/tests/Composer/Test/Fixtures/installer/circular-dependency2.test +++ b/tests/Composer/Test/Fixtures/installer/circular-dependency2.test @@ -2,7 +2,7 @@ Circular dependencies are possible between packages --COMPOSER-- { - "name": "root", + "name": "root/pkg", "version": "dev-master", "require": { "require/itself": "1.0.0", diff --git a/tests/Composer/Test/Fixtures/installer/disjunctive-multi-constraints.test b/tests/Composer/Test/Fixtures/installer/disjunctive-multi-constraints.test index b274c5de2..0e130e747 100644 --- a/tests/Composer/Test/Fixtures/installer/disjunctive-multi-constraints.test +++ b/tests/Composer/Test/Fixtures/installer/disjunctive-multi-constraints.test @@ -6,19 +6,19 @@ Disjunctive multi constraints work { "type": "package", "package": [ - { "name": "foo", "version": "1.1.0" }, - { "name": "foo", "version": "1.0.0" }, - { "name": "bar", "version": "1.1.0", "require": { "foo": "1.0.*" } } + { "name": "foo/pkg", "version": "1.1.0" }, + { "name": "foo/pkg", "version": "1.0.0" }, + { "name": "bar/pkg", "version": "1.1.0", "require": { "foo/pkg": "1.0.*" } } ] } ], "require": { - "bar": "1.*", - "foo": "1.0.*|1.1.*" + "bar/pkg": "1.*", + "foo/pkg": "1.0.*|1.1.*" } } --RUN-- install --EXPECT-- -Installing foo (1.0.0) -Installing bar (1.1.0) +Installing foo/pkg (1.0.0) +Installing bar/pkg (1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/install-from-empty-lock.test b/tests/Composer/Test/Fixtures/installer/install-from-empty-lock.test index c3abd2377..0bba90cff 100644 --- a/tests/Composer/Test/Fixtures/installer/install-from-empty-lock.test +++ b/tests/Composer/Test/Fixtures/installer/install-from-empty-lock.test @@ -6,20 +6,20 @@ Requirements from the composer file are not installed if the lock file is presen { "type": "package", "package": [ - { "name": "required", "version": "1.0.0" }, - { "name": "newly-required", "version": "1.0.0" } + { "name": "required/pkg", "version": "1.0.0" }, + { "name": "newly-required/pkg", "version": "1.0.0" } ] } ], "require": { - "required": "1.0.0", - "newly-required": "1.0.0" + "required/pkg": "1.0.0", + "newly-required/pkg": "1.0.0" } } --LOCK-- { "packages": [ - { "name": "required", "version": "1.0.0" } + { "name": "required/pkg", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -31,4 +31,4 @@ Requirements from the composer file are not installed if the lock file is presen --RUN-- install --EXPECT-- -Installing required (1.0.0) +Installing required/pkg (1.0.0) diff --git a/tests/Composer/Test/Fixtures/installer/install-from-lock-removes-package.test b/tests/Composer/Test/Fixtures/installer/install-from-lock-removes-package.test index d60cd7e94..b1677956c 100644 --- a/tests/Composer/Test/Fixtures/installer/install-from-lock-removes-package.test +++ b/tests/Composer/Test/Fixtures/installer/install-from-lock-removes-package.test @@ -6,24 +6,24 @@ Install from a lock file that deleted a package { "type": "package", "package": [ - { "name": "whitelisted", "version": "1.1.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "fixed-dependency": "1.0.0", "old-dependency": "1.0.0" } }, - { "name": "fixed-dependency", "version": "1.1.0" }, - { "name": "fixed-dependency", "version": "1.0.0" }, - { "name": "old-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.1.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "fixed/dependency": "1.0.0", "old/dependency": "1.0.0" } }, + { "name": "fixed/dependency", "version": "1.1.0" }, + { "name": "fixed/dependency", "version": "1.0.0" }, + { "name": "old/dependency", "version": "1.0.0" } ] } ], "require": { - "whitelisted": "1.*", - "fixed-dependency": "1.*" + "whitelisted/pkg": "1.*", + "fixed/dependency": "1.*" } } --LOCK-- { "packages": [ - { "name": "whitelisted", "version": "1.1.0" }, - { "name": "fixed-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.1.0" }, + { "name": "fixed/dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -33,12 +33,12 @@ Install from a lock file that deleted a package } --INSTALLED-- [ - { "name": "whitelisted", "version": "1.0.0", "require": { "old-dependency": "1.0.0", "fixed-dependency": "1.0.0" } }, - { "name": "fixed-dependency", "version": "1.0.0" }, - { "name": "old-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } }, + { "name": "fixed/dependency", "version": "1.0.0" }, + { "name": "old/dependency", "version": "1.0.0" } ] --RUN-- install --EXPECT-- -Uninstalling old-dependency (1.0.0) -Upgrading whitelisted (1.0.0 => 1.1.0) +Uninstalling old/dependency (1.0.0) +Upgrading whitelisted/pkg (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/plugins-are-installed-first.test b/tests/Composer/Test/Fixtures/installer/plugins-are-installed-first.test index 009eb576d..6a8b2030c 100644 --- a/tests/Composer/Test/Fixtures/installer/plugins-are-installed-first.test +++ b/tests/Composer/Test/Fixtures/installer/plugins-are-installed-first.test @@ -6,26 +6,26 @@ Composer installers and their requirements are installed first { "type": "package", "package": [ - { "name": "pkg", "version": "1.0.0" }, - { "name": "pkg2", "version": "1.0.0" }, - { "name": "inst", "version": "1.0.0", "type": "composer-plugin" }, - { "name": "inst-with-req", "version": "1.0.0", "type": "composer-plugin", "require": { "php": ">=5", "ext-json": "*", "composer-plugin-api": "*" } }, - { "name": "inst-with-req2", "version": "1.0.0", "type": "composer-plugin", "require": { "pkg2": "*" } } + { "name": "pkg/1", "version": "1.0.0" }, + { "name": "pkg/2", "version": "1.0.0" }, + { "name": "inst/pkg", "version": "1.0.0", "type": "composer-plugin" }, + { "name": "inst/with-req", "version": "1.0.0", "type": "composer-plugin", "require": { "php": ">=5", "ext-json": "*", "composer-plugin-api": "*" } }, + { "name": "inst/with-req2", "version": "1.0.0", "type": "composer-plugin", "require": { "pkg/2": "*" } } ] } ], "require": { - "pkg": "1.0.0", - "inst": "1.0.0", - "inst-with-req2": "1.0.0", - "inst-with-req": "1.0.0" + "pkg/1": "1.0.0", + "inst/pkg": "1.0.0", + "inst/with-req2": "1.0.0", + "inst/with-req": "1.0.0" } } --RUN-- install --EXPECT-- -Installing inst (1.0.0) -Installing inst-with-req (1.0.0) -Installing pkg2 (1.0.0) -Installing inst-with-req2 (1.0.0) -Installing pkg (1.0.0) +Installing inst/pkg (1.0.0) +Installing inst/with-req (1.0.0) +Installing pkg/2 (1.0.0) +Installing inst/with-req2 (1.0.0) +Installing pkg/1 (1.0.0) diff --git a/tests/Composer/Test/Fixtures/installer/replace-priorities.test b/tests/Composer/Test/Fixtures/installer/replace-priorities.test index d69dd9a22..e561b548b 100644 --- a/tests/Composer/Test/Fixtures/installer/replace-priorities.test +++ b/tests/Composer/Test/Fixtures/installer/replace-priorities.test @@ -6,28 +6,28 @@ Replace takes precedence only in higher priority repositories and if explicitly { "type": "package", "package": [ - { "name": "forked", "version": "1.1.0", "replace": { "package2": "1.1.0" } } + { "name": "forked/pkg", "version": "1.1.0", "replace": { "package/2": "1.1.0" } } ] }, { "type": "package", "package": [ - { "name": "package", "version": "1.0.0" }, - { "name": "package2", "version": "1.0.0" }, - { "name": "package3", "version": "1.0.0", "require": { "forked": "*" } }, - { "name": "hijacker", "version": "1.1.0", "replace": { "package": "1.1.0" } } + { "name": "package/1", "version": "1.0.0" }, + { "name": "package/2", "version": "1.0.0" }, + { "name": "package/3", "version": "1.0.0", "require": { "forked/pkg": "*" } }, + { "name": "hijacker/pkg", "version": "1.1.0", "replace": { "package/1": "1.1.0" } } ] } ], "require": { - "package": "1.*", - "package2": "1.*", - "package3": "1.*" + "package/1": "1.*", + "package/2": "1.*", + "package/3": "1.*" } } --RUN-- install --EXPECT-- -Installing package (1.0.0) -Installing forked (1.1.0) -Installing package3 (1.0.0) +Installing package/1 (1.0.0) +Installing forked/pkg (1.1.0) +Installing package/3 (1.0.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-locked-require.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-locked-require.test index 3fb16d52f..0f009ae6f 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-locked-require.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-locked-require.test @@ -6,36 +6,36 @@ Update with a package whitelist only updates those packages if they are not pres { "type": "package", "package": [ - { "name": "whitelisted", "version": "1.1.0", "require": { "dependency": "1.1.0", "fixed-dependency": "1.*" } }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0", "fixed-dependency": "1.*" } }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "fixed-dependency", "version": "1.1.0", "require": { "fixed-sub-dependency": "1.*" } }, - { "name": "fixed-dependency", "version": "1.0.0", "require": { "fixed-sub-dependency": "1.*" } }, - { "name": "fixed-sub-dependency", "version": "1.1.0" }, - { "name": "fixed-sub-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0", "fixed/dependency": "1.*" } }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "fixed/dependency", "version": "1.1.0", "require": { "fixed/sub-dependency": "1.*" } }, + { "name": "fixed/dependency", "version": "1.0.0", "require": { "fixed/sub-dependency": "1.*" } }, + { "name": "fixed/sub-dependency", "version": "1.1.0" }, + { "name": "fixed/sub-dependency", "version": "1.0.0" } ] } ], "require": { - "whitelisted": "1.*", - "fixed-dependency": "1.*" + "whitelisted/pkg": "1.*", + "fixed/dependency": "1.*" } } --INSTALLED-- [ - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0", "fixed-dependency": "1.*" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "fixed-dependency", "version": "1.0.0", "require": { "fixed-sub-dependency": "1.*" } }, - { "name": "fixed-sub-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "fixed/dependency", "version": "1.0.0", "require": { "fixed/sub-dependency": "1.*" } }, + { "name": "fixed/sub-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0", "fixed-dependency": "1.*" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "fixed-dependency", "version": "1.0.0", "require": { "fixed-sub-dependency": "1.*" } }, - { "name": "fixed-sub-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0", "fixed/dependency": "1.*" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "fixed/dependency", "version": "1.0.0", "require": { "fixed/sub-dependency": "1.*" } }, + { "name": "fixed/sub-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -47,7 +47,7 @@ Update with a package whitelist only updates those packages if they are not pres "platform-dev": [] } --RUN-- -update whitelisted dependency +update whitelisted/pkg dependency/pkg --EXPECT-- -Upgrading dependency (1.0.0 => 1.1.0) -Upgrading whitelisted (1.0.0 => 1.1.0) +Upgrading dependency/pkg (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-all-dependencies.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-all-dependencies.test index cbf350f0b..95fd639f2 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-all-dependencies.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-all-dependencies.test @@ -6,47 +6,47 @@ Update with a package whitelist pattern and all-dependencies flag updates packag { "type": "package", "package": [ - { "name": "fixed", "version": "1.1.0" }, - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.1.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.1.0", "require": { "dependency": "1.*" } }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.*" } }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.1.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.1.0" }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.1.0" }, + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.1.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.1.0" }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] } ], "require": { - "fixed": "1.*", - "whitelisted-component1": "1.*", - "whitelisted-component2": "1.*", - "dependency": "1.*", - "unrelated": "1.*" + "fixed/pkg": "1.*", + "whitelisted/pkg-component1": "1.*", + "whitelisted/pkg-component2": "1.*", + "dependency/pkg": "1.*", + "unrelated/pkg": "1.*" } } --INSTALLED-- [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -58,8 +58,8 @@ Update with a package whitelist pattern and all-dependencies flag updates packag "platform-dev": [] } --RUN-- -update whitelisted-* --with-all-dependencies +update whitelisted/pkg-* --with-all-dependencies --EXPECT-- -Upgrading whitelisted-component1 (1.0.0 => 1.1.0) -Upgrading dependency (1.0.0 => 1.1.0) -Upgrading whitelisted-component2 (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) +Upgrading dependency/pkg (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-dependencies.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-dependencies.test index 68c1218c3..d40a924ab 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-dependencies.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-dependencies.test @@ -6,51 +6,51 @@ Update with a package whitelist only updates those packages and their dependenci { "type": "package", "package": [ - { "name": "fixed", "version": "1.1.0" }, - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.1.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.1.0", "require": { "dependency": "1.*", "root-dependency": "1.*" } }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.*", "root-dependency": "1.*" } }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "root-dependency", "version": "1.1.0" }, - { "name": "root-dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.1.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.1.0" }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.1.0" }, + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.1.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*", "root/pkg-dependency": "1.*" } }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*", "root/pkg-dependency": "1.*" } }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "root/pkg-dependency", "version": "1.1.0" }, + { "name": "root/pkg-dependency", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.1.0" }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] } ], "require": { - "fixed": "1.*", - "whitelisted-component1": "1.*", - "whitelisted-component2": "1.*", - "root-dependency": "1.*", - "unrelated": "1.*" + "fixed/pkg": "1.*", + "whitelisted/pkg-component1": "1.*", + "whitelisted/pkg-component2": "1.*", + "root/pkg-dependency": "1.*", + "unrelated/pkg": "1.*" } } --INSTALLED-- [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "root-dependency", "version": "1.0.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "root/pkg-dependency", "version": "1.0.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "root-dependency", "version": "1.0.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "root/pkg-dependency", "version": "1.0.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -60,8 +60,8 @@ Update with a package whitelist only updates those packages and their dependenci "prefer-lowest": false } --RUN-- -update whitelisted-* --with-dependencies +update whitelisted/pkg-* --with-dependencies --EXPECT-- -Upgrading whitelisted-component1 (1.0.0 => 1.1.0) -Upgrading dependency (1.0.0 => 1.1.0) -Upgrading whitelisted-component2 (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) +Upgrading dependency/pkg (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-root-dependencies.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-root-dependencies.test index dab3d87e3..02f544577 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-root-dependencies.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-with-root-dependencies.test @@ -6,59 +6,59 @@ Update with a package whitelist only updates those packages and their dependenci { "type": "package", "package": [ - { "name": "fixed", "version": "1.1.0" }, - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.1.0", "require": { "whitelisted-component2": "1.1.0" } }, - { "name": "whitelisted-component1", "version": "1.0.0", "require": { "whitelisted-component2": "1.0.0" } }, - { "name": "whitelisted-component2", "version": "1.1.0", "require": { "dependency": "1.1.0", "whitelisted-component5": "1.0.0" } }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "whitelisted-component3", "version": "1.1.0", "require": { "whitelisted-component4": "1.1.0" } }, - { "name": "whitelisted-component3", "version": "1.0.0", "require": { "whitelisted-component4": "1.0.0" } }, - { "name": "whitelisted-component4", "version": "1.1.0" }, - { "name": "whitelisted-component4", "version": "1.0.0" }, - { "name": "whitelisted-component5", "version": "1.1.0" }, - { "name": "whitelisted-component5", "version": "1.0.0" }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.1.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.1.0" }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.1.0" }, + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.1.0", "require": { "whitelisted/pkg-component2": "1.1.0" } }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } }, + { "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0", "whitelisted/pkg-component5": "1.0.0" } }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "whitelisted/pkg-component3", "version": "1.1.0", "require": { "whitelisted/pkg-component4": "1.1.0" } }, + { "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } }, + { "name": "whitelisted/pkg-component4", "version": "1.1.0" }, + { "name": "whitelisted/pkg-component4", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component5", "version": "1.1.0" }, + { "name": "whitelisted/pkg-component5", "version": "1.0.0" }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.1.0" }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] } ], "require": { - "fixed": "1.*", - "whitelisted-component1": "1.*", - "whitelisted-component2": "1.*", - "whitelisted-component3": "1.0.0", - "unrelated": "1.*" + "fixed/pkg": "1.*", + "whitelisted/pkg-component1": "1.*", + "whitelisted/pkg-component2": "1.*", + "whitelisted/pkg-component3": "1.0.0", + "unrelated/pkg": "1.*" } } --INSTALLED-- [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0", "require": { "whitelisted-component2": "1.0.0" } }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "whitelisted-component3", "version": "1.0.0", "require": { "whitelisted-component4": "1.0.0" } }, - { "name": "whitelisted-component4", "version": "1.0.0" }, - { "name": "whitelisted-component5", "version": "1.0.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } }, + { "name": "whitelisted/pkg-component4", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component5", "version": "1.0.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0", "require": { "whitelisted-component2": "1.0.0" } }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "whitelisted-component3", "version": "1.0.0", "require": { "whitelisted-component4": "1.0.0" } }, - { "name": "whitelisted-component4", "version": "1.0.0" }, - { "name": "whitelisted-component5", "version": "1.0.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0", "require": { "whitelisted/pkg-component2": "1.0.0" } }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "whitelisted/pkg-component3", "version": "1.0.0", "require": { "whitelisted/pkg-component4": "1.0.0" } }, + { "name": "whitelisted/pkg-component4", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component5", "version": "1.0.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -70,8 +70,8 @@ Update with a package whitelist only updates those packages and their dependenci "platform-dev": [] } --RUN-- -update whitelisted-* --with-dependencies +update whitelisted/pkg-* --with-dependencies --EXPECT-- -Upgrading dependency (1.0.0 => 1.1.0) -Upgrading whitelisted-component2 (1.0.0 => 1.1.0) -Upgrading whitelisted-component1 (1.0.0 => 1.1.0) +Upgrading dependency/pkg (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-without-dependencies.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-without-dependencies.test index 337fe3a9b..6cd1d7778 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-without-dependencies.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns-without-dependencies.test @@ -6,46 +6,46 @@ Update with a package whitelist only updates those packages matching the pattern { "type": "package", "package": [ - { "name": "fixed", "version": "1.1.0" }, - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.1.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.1.0", "require": { "dependency": "1.*" } }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.*" } }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.1.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.1.0" }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.1.0" }, + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.1.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.1.0" }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] } ], "require": { - "fixed": "1.*", - "whitelisted-component1": "1.*", - "whitelisted-component2": "1.*", - "unrelated": "1.*" + "fixed/pkg": "1.*", + "whitelisted/pkg-component1": "1.*", + "whitelisted/pkg-component2": "1.*", + "unrelated/pkg": "1.*" } } --INSTALLED-- [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted-component1", "version": "1.0.0" }, - { "name": "whitelisted-component2", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component1", "version": "1.0.0" }, + { "name": "whitelisted/pkg-component2", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -55,7 +55,7 @@ Update with a package whitelist only updates those packages matching the pattern "prefer-lowest": false } --RUN-- -update whitelisted-* +update whitelisted/pkg-* --EXPECT-- -Upgrading whitelisted-component1 (1.0.0 => 1.1.0) -Upgrading whitelisted-component2 (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component1 (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg-component2 (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns.test index 8e4fd2034..738f0af74 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-patterns.test @@ -6,48 +6,48 @@ Update with a package whitelist only updates those corresponding to the pattern { "type": "package", "package": [ - { "name": "vendor/Test-Package", "version": "2.0" }, - { "name": "vendor/NotMe", "version": "2.0" }, - { "name": "exact/Test-Package", "version": "2.0" }, - { "name": "notexact/TestPackage", "version": "2.0" }, - { "name": "all/Package1", "version": "2.0" }, - { "name": "all/Package2", "version": "2.0" }, + { "name": "vendor/test-package", "version": "2.0" }, + { "name": "vendor/not-me", "version": "2.0" }, + { "name": "exact/test-package", "version": "2.0" }, + { "name": "notexact/testpackage", "version": "2.0" }, + { "name": "all/package1", "version": "2.0" }, + { "name": "all/package2", "version": "2.0" }, { "name": "another/another", "version": "2.0" }, { "name": "no/regexp", "version": "2.0" } ] } ], "require": { - "vendor/Test-Package": "*.*", - "vendor/NotMe": "*.*", - "exact/Test-Package": "*.*", - "notexact/TestPackage": "*.*", - "all/Package1": "*.*", - "all/Package2": "*.*", + "vendor/test-package": "*.*", + "vendor/not-me": "*.*", + "exact/test-package": "*.*", + "notexact/testpackage": "*.*", + "all/package1": "*.*", + "all/package2": "*.*", "another/another": "*.*", "no/regexp": "*.*" } } --INSTALLED-- [ - { "name": "vendor/Test-Package", "version": "1.0" }, - { "name": "vendor/NotMe", "version": "1.0" }, - { "name": "exact/Test-Package", "version": "1.0" }, - { "name": "notexact/TestPackage", "version": "1.0" }, - { "name": "all/Package1", "version": "1.0" }, - { "name": "all/Package2", "version": "1.0" }, + { "name": "vendor/test-package", "version": "1.0" }, + { "name": "vendor/not-me", "version": "1.0" }, + { "name": "exact/test-package", "version": "1.0" }, + { "name": "notexact/testpackage", "version": "1.0" }, + { "name": "all/package1", "version": "1.0" }, + { "name": "all/package2", "version": "1.0" }, { "name": "another/another", "version": "1.0" }, { "name": "no/regexp", "version": "1.0" } ] --LOCK-- { "packages": [ - { "name": "vendor/Test-Package", "version": "1.0" }, - { "name": "vendor/NotMe", "version": "1.0" }, - { "name": "exact/Test-Package", "version": "1.0" }, - { "name": "notexact/TestPackage", "version": "1.0" }, - { "name": "all/Package1", "version": "1.0" }, - { "name": "all/Package2", "version": "1.0" }, + { "name": "vendor/test-package", "version": "1.0" }, + { "name": "vendor/not-me", "version": "1.0" }, + { "name": "exact/test-package", "version": "1.0" }, + { "name": "notexact/testpackage", "version": "1.0" }, + { "name": "all/package1", "version": "1.0" }, + { "name": "all/package2", "version": "1.0" }, { "name": "another/another", "version": "1.0" }, { "name": "no/regexp", "version": "1.0" } ], @@ -61,9 +61,9 @@ Update with a package whitelist only updates those corresponding to the pattern "platform-dev": [] } --RUN-- -update vendor/Test* exact/Test-Package notexact/Test all/* no/reg?xp +update vendor/Test* exact/test-package notexact/Test all/* no/reg.?xp --EXPECT-- -Upgrading all/Package1 (1.0 => 2.0) -Upgrading all/Package2 (1.0 => 2.0) -Upgrading exact/Test-Package (1.0 => 2.0) -Upgrading vendor/Test-Package (1.0 => 2.0) +Upgrading all/package1 (1.0 => 2.0) +Upgrading all/package2 (1.0 => 2.0) +Upgrading exact/test-package (1.0 => 2.0) +Upgrading vendor/test-package (1.0 => 2.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-removes-unused.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-removes-unused.test index 7b720e3ca..0863d1321 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-removes-unused.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-removes-unused.test @@ -6,31 +6,31 @@ Update with a package whitelist removes unused packages { "type": "package", "package": [ - { "name": "whitelisted", "version": "1.1.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "fixed-dependency": "1.0.0", "old-dependency": "1.0.0" } }, - { "name": "fixed-dependency", "version": "1.1.0" }, - { "name": "fixed-dependency", "version": "1.0.0" }, - { "name": "old-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.1.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "fixed/dependency": "1.0.0", "old/dependency": "1.0.0" } }, + { "name": "fixed/dependency", "version": "1.1.0" }, + { "name": "fixed/dependency", "version": "1.0.0" }, + { "name": "old/dependency", "version": "1.0.0" } ] } ], "require": { - "whitelisted": "1.*", - "fixed-dependency": "1.*" + "whitelisted/pkg": "1.*", + "fixed/dependency": "1.*" } } --INSTALLED-- [ - { "name": "whitelisted", "version": "1.0.0", "require": { "old-dependency": "1.0.0", "fixed-dependency": "1.0.0" } }, - { "name": "fixed-dependency", "version": "1.0.0" }, - { "name": "old-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } }, + { "name": "fixed/dependency", "version": "1.0.0" }, + { "name": "old/dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "whitelisted", "version": "1.0.0", "require": { "old-dependency": "1.0.0", "fixed-dependency": "1.0.0" } }, - { "name": "fixed-dependency", "version": "1.0.0" }, - { "name": "old-dependency", "version": "1.0.0" } + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "old/dependency": "1.0.0", "fixed/dependency": "1.0.0" } }, + { "name": "fixed/dependency", "version": "1.0.0" }, + { "name": "old/dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -42,7 +42,7 @@ Update with a package whitelist removes unused packages "platform-dev": [] } --RUN-- -update --with-dependencies whitelisted +update --with-dependencies whitelisted/pkg --EXPECT-- -Uninstalling old-dependency (1.0.0) -Upgrading whitelisted (1.0.0 => 1.1.0) +Uninstalling old/dependency (1.0.0) +Upgrading whitelisted/pkg (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependencies.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependencies.test index 02e772337..079ad9d2b 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependencies.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependencies.test @@ -6,41 +6,41 @@ Update with a package whitelist only updates those packages and their dependenci { "type": "package", "package": [ - { "name": "fixed", "version": "1.1.0" }, - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.1.0", "require": { "dependency": "1.1.0" } }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.1.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.1.0" }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.1.0" }, + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0" } }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.1.0" }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] } ], "require": { - "fixed": "1.*", - "whitelisted": "1.*", - "unrelated": "1.*" + "fixed/pkg": "1.*", + "whitelisted/pkg": "1.*", + "unrelated/pkg": "1.*" } } --INSTALLED-- [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -50,7 +50,7 @@ Update with a package whitelist only updates those packages and their dependenci "prefer-lowest": false } --RUN-- -update whitelisted --with-dependencies +update whitelisted/pkg --with-dependencies --EXPECT-- -Upgrading dependency (1.0.0 => 1.1.0) -Upgrading whitelisted (1.0.0 => 1.1.0) +Upgrading dependency/pkg (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependency-conflict.test b/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependency-conflict.test index 38a7bbf54..299c505cb 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependency-conflict.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist-with-dependency-conflict.test @@ -6,41 +6,41 @@ Update with a package whitelist only updates whitelisted packages if no dependen { "type": "package", "package": [ - { "name": "fixed", "version": "1.1.0" }, - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.1.0", "require": { "dependency": "1.1.0" } }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.1.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.1.0" }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.1.0" }, + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.1.0" } }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.1.0" }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] } ], "require": { - "fixed": "1.*", - "whitelisted": "1.*", - "unrelated": "1.*" + "fixed/pkg": "1.*", + "whitelisted/pkg": "1.*", + "unrelated/pkg": "1.*" } } --INSTALLED-- [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.0.0" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.0.0" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -50,5 +50,5 @@ Update with a package whitelist only updates whitelisted packages if no dependen "prefer-lowest": false } --RUN-- -update whitelisted +update whitelisted/pkg --EXPECT-- diff --git a/tests/Composer/Test/Fixtures/installer/update-whitelist.test b/tests/Composer/Test/Fixtures/installer/update-whitelist.test index 826f9fce1..a02e00c4b 100644 --- a/tests/Composer/Test/Fixtures/installer/update-whitelist.test +++ b/tests/Composer/Test/Fixtures/installer/update-whitelist.test @@ -6,41 +6,41 @@ Update with a package whitelist only updates those packages listed as command ar { "type": "package", "package": [ - { "name": "fixed", "version": "1.1.0" }, - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.1.0", "require": { "dependency": "1.*" } }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.*" } }, - { "name": "dependency", "version": "1.1.0" }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.1.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.1.0" }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.1.0" }, + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.1.0", "require": { "dependency/pkg": "1.*" } }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, + { "name": "dependency/pkg", "version": "1.1.0" }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.1.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.1.0" }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] } ], "require": { - "fixed": "1.*", - "whitelisted": "1.*", - "unrelated": "1.*" + "fixed/pkg": "1.*", + "whitelisted/pkg": "1.*", + "unrelated/pkg": "1.*" } } --INSTALLED-- [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.*" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency": "1.*" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ] --LOCK-- { "packages": [ - { "name": "fixed", "version": "1.0.0" }, - { "name": "whitelisted", "version": "1.0.0", "require": { "dependency": "1.*" } }, - { "name": "dependency", "version": "1.0.0" }, - { "name": "unrelated", "version": "1.0.0", "require": { "unrelated-dependency": "1.*" } }, - { "name": "unrelated-dependency", "version": "1.0.0" } + { "name": "fixed/pkg", "version": "1.0.0" }, + { "name": "whitelisted/pkg", "version": "1.0.0", "require": { "dependency/pkg": "1.*" } }, + { "name": "dependency/pkg", "version": "1.0.0" }, + { "name": "unrelated/pkg", "version": "1.0.0", "require": { "unrelated/pkg-dependency": "1.*" } }, + { "name": "unrelated/pkg-dependency", "version": "1.0.0" } ], "packages-dev": [], "aliases": [], @@ -52,6 +52,6 @@ Update with a package whitelist only updates those packages listed as command ar "platform-dev": [] } --RUN-- -update whitelisted +update whitelisted/pkg --EXPECT-- -Upgrading whitelisted (1.0.0 => 1.1.0) +Upgrading whitelisted/pkg (1.0.0 => 1.1.0) diff --git a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php index a94539279..25d39270c 100644 --- a/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php +++ b/tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php @@ -46,8 +46,8 @@ class RootPackageLoaderTest extends TestCase 'zux/complex' => '~1.0,>=1.0.2@dev', 'or/op' => '^2.0@dev || ^2.0@dev', 'multi/lowest-wins' => '^2.0@rc || >=3.0@dev , ~3.5@alpha', - 'or/op/without-flags' => 'dev-master || 2.0 , ~3.5-alpha', - 'or/op/without-flags2' => '3.0-beta || 2.0 , ~3.5-alpha', + 'or/op-without-flags' => 'dev-master || 2.0 , ~3.5-alpha', + 'or/op-without-flags2' => '3.0-beta || 2.0 , ~3.5-alpha', ), 'minimum-stability' => 'alpha', )); @@ -59,8 +59,8 @@ class RootPackageLoaderTest extends TestCase 'zux/complex' => BasePackage::STABILITY_DEV, 'or/op' => BasePackage::STABILITY_DEV, 'multi/lowest-wins' => BasePackage::STABILITY_DEV, - 'or/op/without-flags' => BasePackage::STABILITY_DEV, - 'or/op/without-flags2' => BasePackage::STABILITY_ALPHA, + 'or/op-without-flags' => BasePackage::STABILITY_DEV, + 'or/op-without-flags2' => BasePackage::STABILITY_ALPHA, ), $package->getStabilityFlags()); }