mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Improve error reporting of solver issues, refs #7779
Fixes #8525 Fixes #6513
This commit is contained in:
parent
f611c641db
commit
3fc7e10c5c
34 changed files with 482 additions and 223 deletions
|
@ -143,12 +143,18 @@ class RuleSetTest extends TestCase
|
|||
$p = $this->getPackage('foo', '2.1'),
|
||||
));
|
||||
|
||||
$repositorySetMock = $this->getMockBuilder('Composer\Repository\RepositorySet')->disableOriginalConstructor()->getMock();
|
||||
$repositorySetMock->expects($this->any())
|
||||
->method('getPool')
|
||||
->willReturn($pool);
|
||||
$requestMock = $this->getMockBuilder('Composer\DependencyResolver\Request')->disableOriginalConstructor()->getMock();
|
||||
|
||||
$ruleSet = new RuleSet;
|
||||
$literal = $p->getId();
|
||||
$rule = new GenericRule(array($literal), Rule::RULE_ROOT_REQUIRE, array('packageName' => 'foo/bar', 'constraint' => null));
|
||||
|
||||
$ruleSet->add($rule, RuleSet::TYPE_REQUEST);
|
||||
|
||||
$this->assertContains('REQUEST : No package found to satisfy root composer.json require foo/bar', $ruleSet->getPrettyString($pool));
|
||||
$this->assertContains('REQUEST : No package found to satisfy root composer.json require foo/bar', $ruleSet->getPrettyString($repositorySetMock, $requestMock));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue