From 2ed0bfc1ba6dda1b1bd318cc0418a6d1ac720e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Somfai?= Date: Sat, 18 Jan 2014 21:09:23 +0100 Subject: [PATCH] added tests for not updating packages referenced by specific commit hash --- .../update-installed-reference-dry-run.test | 30 +++++++++++++++++++ .../installer/update-installed-reference.test | 30 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/update-installed-reference-dry-run.test create mode 100644 tests/Composer/Test/Fixtures/installer/update-installed-reference.test diff --git a/tests/Composer/Test/Fixtures/installer/update-installed-reference-dry-run.test b/tests/Composer/Test/Fixtures/installer/update-installed-reference-dry-run.test new file mode 100644 index 000000000..3c9036be4 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/update-installed-reference-dry-run.test @@ -0,0 +1,30 @@ +--TEST-- +Updating a dev package forcing it's reference, using dry run, should not do anything if the referenced version is the installed one +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "abc123", "url": "", "type": "git" } + } + ] + } + ], + "require": { + "a/a": "dev-master#def000" + } +} +--INSTALLED-- +[ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "def000", "url": "", "type": "git" }, + "dist": { "reference": "def000", "url": "", "type": "zip", "shasum": "" } + } +] +--RUN-- +update --dry-run +--EXPECT-- diff --git a/tests/Composer/Test/Fixtures/installer/update-installed-reference.test b/tests/Composer/Test/Fixtures/installer/update-installed-reference.test new file mode 100644 index 000000000..e6814ccfe --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/update-installed-reference.test @@ -0,0 +1,30 @@ +--TEST-- +Updating a dev package forcing it's reference should not do anything if the referenced version is the installed one +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "abc123", "url": "", "type": "git" } + } + ] + } + ], + "require": { + "a/a": "dev-master#def000" + } +} +--INSTALLED-- +[ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "def000", "url": "", "type": "git" }, + "dist": { "reference": "def000", "url": "", "type": "zip", "shasum": "" } + } +] +--RUN-- +update +--EXPECT--