From 37ef2037cff090f22bf1be3bf141fd7e6b35b53e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 11 Jul 2012 13:00:41 +0200 Subject: [PATCH] Add test case to ensure replace does not allow hijacking packages --- .../installer/replace-priorities.test | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/replace-priorities.test diff --git a/tests/Composer/Test/Fixtures/installer/replace-priorities.test b/tests/Composer/Test/Fixtures/installer/replace-priorities.test new file mode 100644 index 000000000..c6c77c060 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/replace-priorities.test @@ -0,0 +1,30 @@ +--TEST-- +Replace takes precedence only in higher priority repositories +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { "name": "forked", "version": "1.1.0", "provide": { "package2": "1.1.0" } } + ] + }, + { + "type": "package", + "package": [ + { "name": "package", "version": "1.0.0" }, + { "name": "package2", "version": "1.0.0" }, + { "name": "hijacker", "version": "1.1.0", "provide": { "package": "1.1.0" } } + ] + } + ], + "require": { + "package": "1.*", + "package2": "1.*" + } +} +--RUN-- +install +--EXPECT-- +Installing package (1.0.0) +Installing forked (1.1.0)