From c31f4be112fdd0d5de078e5f8eb6d29395b237e9 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 7 Jan 2013 20:27:52 +0100 Subject: [PATCH] Add test to verify url and and hash are updated, fixes #1460 --- ...pdating-dev-updates-url-and-reference.test | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/updating-dev-updates-url-and-reference.test diff --git a/tests/Composer/Test/Fixtures/installer/updating-dev-updates-url-and-reference.test b/tests/Composer/Test/Fixtures/installer/updating-dev-updates-url-and-reference.test new file mode 100644 index 000000000..272dfc819 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/updating-dev-updates-url-and-reference.test @@ -0,0 +1,62 @@ +--TEST-- +Updating a dev package for new reference updates the url and reference +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "newref", "url": "newurl", "type": "git" }, + "dist": { "reference": "newref", "url": "newurl", "type": "zip", "shasum": "" } + } + ] + } + ], + "minimum-stability": "dev", + "require": { + "a/a": "dev-master" + } +} +--LOCK-- +{ + "packages": [ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "oldref", "url": "oldurl", "type": "git" }, + "dist": { "reference": "oldref", "url": "oldurl", "type": "zip", "shasum": "" } + } + ], + "packages-dev": null, + "aliases": [], + "minimum-stability": "dev", + "stability-flags": {"a/a":20} +} +--INSTALLED-- +[ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "oldref", "url": "oldurl", "type": "git" }, + "dist": { "reference": "oldref", "url": "oldurl", "type": "zip", "shasum": "" } + } +] +--RUN-- +update +--EXPECT-LOCK-- +{ + "packages": [ + { + "name": "a/a", "version": "dev-master", + "type": "library", + "source": { "reference": "newref", "url": "newurl", "type": "git" }, + "dist": { "reference": "newref", "url": "newurl", "type": "zip", "shasum": "" } + } + ], + "packages-dev": null, + "aliases": [], + "minimum-stability": "dev", + "stability-flags": {"a/a":20} +} +--EXPECT-- +Updating a/a (dev-master oldref) to a/a (dev-master newref)