1
0
Fork 0

Cleanup EmptyConstraint output

pull/8850/head
Yanick Witschi 2020-05-01 20:14:04 +02:00 committed by Jordi Boggiano
parent 2427bef238
commit 63906171f0
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
2 changed files with 14 additions and 8 deletions

View File

@ -102,8 +102,8 @@ class RuleTest extends TestCase
$repositorySetMock = $this->getMockBuilder('Composer\Repository\RepositorySet')->disableOriginalConstructor()->getMock();
$requestMock = $this->getMockBuilder('Composer\DependencyResolver\Request')->disableOriginalConstructor()->getMock();
$rule = new GenericRule(array($p1->getId(), -$p2->getId()), Rule::RULE_PACKAGE_REQUIRES, new Link('baz', 'foo'));
$rule = new GenericRule(array($p1->getId(), -$p2->getId()), Rule::RULE_PACKAGE_REQUIRES, new Link('baz', 'foo', 'relates to', '*'));
$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));
}
}

View File

@ -639,8 +639,11 @@ class SolverTest extends TestCase
$this->reposComplete();
$this->request->requireName('A');
$this->request->requireName('B');
$emptyConstraint = new EmptyConstraint();
$emptyConstraint->setPrettyString('*');
$this->request->requireName('A', $emptyConstraint);
$this->request->requireName('B', $emptyConstraint);
$this->createSolver();
try {
@ -652,9 +655,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));
}
}
@ -712,7 +715,10 @@ class SolverTest extends TestCase
$this->reposComplete();
$this->request->requireName('A');
$emptyConstraint = new EmptyConstraint();
$emptyConstraint->setPrettyString('*');
$this->request->requireName('A', $emptyConstraint);
$this->createSolver();
try {
@ -729,7 +735,7 @@ class SolverTest extends TestCase
$msg .= " - B 1.0 requires c >= 1.0 -> satisfiable by C[1.0].\n";
$msg .= " - You can only install one version of a package, so only one of these can be installed: B[0.9, 1.0].\n";
$msg .= " - A 1.0 requires b >= 1.0 -> satisfiable by B[1.0].\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";
$this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool, false));
}
}