diff --git a/tests/Composer/Test/Fixtures/installer/conflict-with-alias-does-not-prevent-installation-if-not-required.test b/tests/Composer/Test/Fixtures/installer/conflict-on-root-with-alias-does-not-prevent-update-if-not-required.test similarity index 73% rename from tests/Composer/Test/Fixtures/installer/conflict-with-alias-does-not-prevent-installation-if-not-required.test rename to tests/Composer/Test/Fixtures/installer/conflict-on-root-with-alias-does-not-prevent-update-if-not-required.test index 542a883f2..454384206 100644 --- a/tests/Composer/Test/Fixtures/installer/conflict-with-alias-does-not-prevent-installation-if-not-required.test +++ b/tests/Composer/Test/Fixtures/installer/conflict-on-root-with-alias-does-not-prevent-update-if-not-required.test @@ -27,6 +27,22 @@ and we don't want to modify branch alias meta data in the lock file. } --RUN-- update +--EXPECT-LOCK-- +{ + "packages": [ + { "name": "some/dep", "version": "dev-main", "type": "library", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} } } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "some/dep": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} --EXPECT-- Installing some/dep (dev-main) -Marking some/dep (1.3.x-dev) as installed, alias of some/dep (dev-main)' +Marking some/dep (1.3.x-dev) as installed, alias of some/dep (dev-main) diff --git a/tests/Composer/Test/Fixtures/installer/conflict-with-alias-does-not-prevent-update-if-not-required.test b/tests/Composer/Test/Fixtures/installer/conflict-with-alias-does-not-prevent-update-if-not-required.test new file mode 100644 index 000000000..e03cd0f2a --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/conflict-with-alias-does-not-prevent-update-if-not-required.test @@ -0,0 +1,45 @@ +--TEST-- +Test that conflict on a branch alias is ignored if the alias is not required for installation. +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { "name": "some/dep", "version": "1.0.0" }, + { "name": "some/dep", "version": "1.1.0" }, + { "name": "some/dep", "version": "1.2.0" }, + { "name": "some/dep", "version": "dev-main", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} } }, + { "name": "some/dep", "version": "1.2.x-dev" }, + { "name": "conflictor/foo", "version": "1.0.0", "conflict": { "some/dep": ">=1.3" } } + ] + } + ], + "require": { + "some/dep": "dev-main", + "conflictor/foo": "1.0.0" + } +} +--RUN-- +update +--EXPECT-LOCK-- +{ + "packages": [ + { "name": "conflictor/foo", "version": "1.0.0", "conflict": { "some/dep": ">=1.3" }, "type": "library" }, + { "name": "some/dep", "version": "dev-main", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} }, "type": "library" } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "some/dep": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} +--EXPECT-- +Installing conflictor/foo (1.0.0) +Installing some/dep (dev-main) +Marking some/dep (1.3.x-dev) as installed, alias of some/dep (dev-main) diff --git a/tests/Composer/Test/Fixtures/installer/conflict-with-alias-in-lock-does-not-prevent-install-if-not-required.test b/tests/Composer/Test/Fixtures/installer/conflict-with-alias-in-lock-does-not-prevent-install-if-not-required.test new file mode 100644 index 000000000..c6f91e115 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/conflict-with-alias-in-lock-does-not-prevent-install-if-not-required.test @@ -0,0 +1,45 @@ +--TEST-- +Test that conflict on a branch alias is ignored if the alias is not required for installation. +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { "name": "some/dep", "version": "1.0.0" }, + { "name": "some/dep", "version": "1.1.0" }, + { "name": "some/dep", "version": "1.2.0" }, + { "name": "some/dep", "version": "dev-main", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} } }, + { "name": "some/dep", "version": "1.2.x-dev" }, + { "name": "conflictor/foo", "version": "1.0.0", "conflict": { "some/dep": ">=1.3" } } + ] + } + ], + "require": { + "some/dep": "dev-main", + "conflictor/foo": "1.0.0" + } +} +--LOCK-- +{ + "packages": [ + { "name": "conflictor/foo", "version": "1.0.0", "conflict": { "some/dep": ">=1.3" }, "type": "library" }, + { "name": "some/dep", "version": "dev-main", "extra": {"branch-alias": {"dev-main": "1.3.x-dev"} }, "type": "library" } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "some/dep": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} +--RUN-- +install +--EXPECT-- +Installing conflictor/foo (1.0.0) +Installing some/dep (dev-main) +Marking some/dep (1.3.x-dev) as installed, alias of some/dep (dev-main) diff --git a/tests/Composer/Test/Fixtures/installer/conflict-with-alias-prevents-installation.test b/tests/Composer/Test/Fixtures/installer/conflict-with-alias-prevents-update.test similarity index 67% rename from tests/Composer/Test/Fixtures/installer/conflict-with-alias-prevents-installation.test rename to tests/Composer/Test/Fixtures/installer/conflict-with-alias-prevents-update.test index b4425a6eb..74b61304e 100644 --- a/tests/Composer/Test/Fixtures/installer/conflict-with-alias-prevents-installation.test +++ b/tests/Composer/Test/Fixtures/installer/conflict-with-alias-prevents-update.test @@ -23,5 +23,21 @@ Test that conflict on a branch alias is respected } --RUN-- update +--EXPECT-LOCK-- +{ + "packages": [ + { "name": "some/dep", "version": "1.2.x-dev", "type": "library" } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "some/dep": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} --EXPECT-- Installing some/dep (1.2.x-dev)