From 8e2dd62d10b85a3a2de198b5dd100a73e604c4b5 Mon Sep 17 00:00:00 2001 From: Yanick Witschi Date: Thu, 30 Apr 2020 17:40:06 +0200 Subject: [PATCH] Fixed tests related to constraint changes --- tests/Composer/Test/DependencyResolver/RequestTest.php | 3 ++- tests/Composer/Test/DependencyResolver/RuleTest.php | 2 +- tests/Composer/Test/DependencyResolver/SolverTest.php | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/Composer/Test/DependencyResolver/RequestTest.php b/tests/Composer/Test/DependencyResolver/RequestTest.php index e2a3ce9e6..77955597a 100644 --- a/tests/Composer/Test/DependencyResolver/RequestTest.php +++ b/tests/Composer/Test/DependencyResolver/RequestTest.php @@ -14,6 +14,7 @@ namespace Composer\Test\DependencyResolver; use Composer\DependencyResolver\Request; use Composer\Repository\ArrayRepository; +use Composer\Semver\Constraint\EmptyConstraint; use Composer\Test\TestCase; class RequestTest extends TestCase @@ -34,7 +35,7 @@ class RequestTest extends TestCase $this->assertEquals( array( - 'foo' => null, + 'foo' => new EmptyConstraint(), ), $request->getRequires() ); diff --git a/tests/Composer/Test/DependencyResolver/RuleTest.php b/tests/Composer/Test/DependencyResolver/RuleTest.php index 2e1a9921d..fd5567520 100644 --- a/tests/Composer/Test/DependencyResolver/RuleTest.php +++ b/tests/Composer/Test/DependencyResolver/RuleTest.php @@ -104,6 +104,6 @@ class RuleTest extends TestCase $rule = new GenericRule(array($p1->getId(), -$p2->getId()), Rule::RULE_PACKAGE_REQUIRES, new Link('baz', 'foo')); - $this->assertEquals('baz 1.1 relates to foo -> satisfiable by foo[2.1].', $rule->getPrettyString($repositorySetMock, $requestMock, $pool, false)); + $this->assertEquals('baz 1.1 relates to foo [] -> satisfiable by foo[2.1].', $rule->getPrettyString($repositorySetMock, $requestMock, $pool, false)); } } diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index 6fa7f1f84..48a30331f 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -652,9 +652,9 @@ class SolverTest extends TestCase $msg = "\n"; $msg .= " Problem 1\n"; - $msg .= " - Root composer.json requires a -> satisfiable by A[1.0].\n"; + $msg .= " - Root composer.json requires a [] -> satisfiable by 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"; + $msg .= " - Root composer.json requires b [] -> satisfiable by B[1.0].\n"; $this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool, false)); } } @@ -683,7 +683,7 @@ class SolverTest extends TestCase $msg = "\n"; $msg .= " Problem 1\n"; - $msg .= " - Root composer.json requires a -> satisfiable by A[1.0].\n"; + $msg .= " - Root composer.json requires a [] -> satisfiable by A[1.0].\n"; $msg .= " - A 1.0 requires b >= 2.0 -> found B[1.0] but it does not match the constraint.\n"; $this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool, false)); }