From ec90c17e3b40b3c5c3d5d996f9ddacf9edecb852 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 30 Jan 2020 15:51:56 +0100 Subject: [PATCH] Fix conflict order to be more accurate --- src/Composer/DependencyResolver/Rule.php | 2 +- tests/Composer/Test/DependencyResolver/SolverTest.php | 2 +- .../Test/Fixtures/installer/conflict-between-dependents.test | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/DependencyResolver/Rule.php b/src/Composer/DependencyResolver/Rule.php index 7dcdc5711..8f9dbc4ca 100644 --- a/src/Composer/DependencyResolver/Rule.php +++ b/src/Composer/DependencyResolver/Rule.php @@ -162,7 +162,7 @@ abstract class Rule $package1 = $pool->literalToPackage($literals[0]); $package2 = $pool->literalToPackage($literals[1]); - return $package1->getPrettyString().' conflicts with '.$this->formatPackagesUnique($pool, array($package2)).'.'; + return $package2->getPrettyString().' conflicts with '.$package1->getPrettyString().'.'; case self::RULE_PACKAGE_REQUIRES: $sourceLiteral = array_shift($literals); diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index e64002883..c09ac07b1 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -652,7 +652,7 @@ class SolverTest extends TestCase $msg = "\n"; $msg .= " Problem 1\n"; $msg .= " - Root composer.json requires a -> satisfiable by A[1.0].\n"; - $msg .= " - B 1.0 conflicts with A[1.0].\n"; + $msg .= " - A 1.0 conflicts with B 1.0.\n"; $msg .= " - Root composer.json requires b -> satisfiable by B[1.0].\n"; $this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool)); } diff --git a/tests/Composer/Test/Fixtures/installer/conflict-between-dependents.test b/tests/Composer/Test/Fixtures/installer/conflict-between-dependents.test index 40c19f3eb..a59b2ef98 100644 --- a/tests/Composer/Test/Fixtures/installer/conflict-between-dependents.test +++ b/tests/Composer/Test/Fixtures/installer/conflict-between-dependents.test @@ -31,7 +31,7 @@ Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires conflicter/pkg 1.0.0 -> satisfiable by conflicter/pkg[1.0.0]. - - victim/pkg 1.0.0 conflicts with conflicter/pkg[1.0.0]. + - conflicter/pkg 1.0.0 conflicts with victim/pkg 1.0.0. - Root composer.json requires victim/pkg 1.0.0 -> satisfiable by victim/pkg[1.0.0]. --EXPECT--