From 3f48acf56a2a9ac293563d81af0b269b609e58a2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 28 Jan 2020 16:01:17 +0100 Subject: [PATCH] Add test checking references update to latest and remove TODO --- src/Composer/Installer.php | 3 -- .../update-reference-picks-latest.test | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 tests/Composer/Test/Fixtures/installer/update-reference-picks-latest.test diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index b933268c0..bbd81d997 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -388,9 +388,6 @@ class Installer $pool = $repositorySet->createPool($request); - // TODO ensure that the solver always picks most recent reference for dev packages, so they get updated even when just a new commit is pushed but version is unchanged - // should already be solved by using the remote package in all cases in the pool - // solve dependencies $solver = new Solver($policy, $pool, $this->io); try { diff --git a/tests/Composer/Test/Fixtures/installer/update-reference-picks-latest.test b/tests/Composer/Test/Fixtures/installer/update-reference-picks-latest.test new file mode 100644 index 000000000..6b1f540bb --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/update-reference-picks-latest.test @@ -0,0 +1,31 @@ +--TEST-- +Updating a dev package should update to the latest available reference +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": [ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "abc123", "url": "", "type": "git" } + } + ] + } + ], + "require": { + "a/a": "dev-master" + } +} +--INSTALLED-- +[ + { + "name": "a/a", "version": "dev-master", + "source": { "reference": "def000", "url": "", "type": "git" }, + "dist": { "reference": "def000", "url": "", "type": "zip", "shasum": "" } + } +] +--RUN-- +update +--EXPECT-- +Updating a/a (dev-master def000 => dev-master abc123)