From 290450214e203c509304d39d2ffc6d776c7f1154 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 22 Oct 2020 10:26:28 +0200 Subject: [PATCH 1/2] Test: Verify require for package provided by pkg itself is used --- ...rovider-satisfies-its-own-requirement.test | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/provider-satisfies-its-own-requirement.test diff --git a/tests/Composer/Test/Fixtures/installer/provider-satisfies-its-own-requirement.test b/tests/Composer/Test/Fixtures/installer/provider-satisfies-its-own-requirement.test new file mode 100644 index 000000000..4aeb65177 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/provider-satisfies-its-own-requirement.test @@ -0,0 +1,25 @@ +--TEST-- +Test that a package requiring something it provides itself, satisfies itself even though a package exists. +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": { + "name": "provided/pkg", + "version": "1.0.0" + } + } + ], + "require": { + "provided/pkg": "1.0.0" + }, + "provide": { + "provided/pkg": "1.0.0" + } +} + +--RUN-- +update + +--EXPECT-- From 1d6c0865cac1436f1a95a785218923ce87a5b97b Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 22 Oct 2020 10:32:04 +0200 Subject: [PATCH 2/2] Test: Verify replacing a package required by the same package satisfies the dep --- ...eplacer-satisfies-its-own-requirement.test | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/Composer/Test/Fixtures/installer/replacer-satisfies-its-own-requirement.test diff --git a/tests/Composer/Test/Fixtures/installer/replacer-satisfies-its-own-requirement.test b/tests/Composer/Test/Fixtures/installer/replacer-satisfies-its-own-requirement.test new file mode 100644 index 000000000..3154071e6 --- /dev/null +++ b/tests/Composer/Test/Fixtures/installer/replacer-satisfies-its-own-requirement.test @@ -0,0 +1,25 @@ +--TEST-- +Test that a package requiring something it replaces itself, satisfies itself even though a package exists. +--COMPOSER-- +{ + "repositories": [ + { + "type": "package", + "package": { + "name": "replaced/pkg", + "version": "1.0.0" + } + } + ], + "require": { + "replaced/pkg": "1.0.0" + }, + "provide": { + "replaced/pkg": "1.0.0" + } +} + +--RUN-- +update + +--EXPECT--