1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Rule literals are sorted, so first literal added is not first retrieved

Fixes #477
This commit is contained in:
Nils Adermann 2012-04-01 22:26:10 +02:00
parent 1fe24a3837
commit a16aa68c1d
2 changed files with 32 additions and 7 deletions

View file

@ -622,6 +622,33 @@ class SolverTest extends TestCase
}
}
public function testLearnLiteralsWithSortedRuleLiterals()
{
$this->repo->addPackage($packageTwig2 = $this->getPackage('twig/twig', '2.0'));
$this->repo->addPackage($packageTwig16 = $this->getPackage('twig/twig', '1.6'));
$this->repo->addPackage($packageTwig15 = $this->getPackage('twig/twig', '1.5'));
$this->repo->addPackage($packageSymfony = $this->getPackage('symfony/symfony', '2.0'));
$this->repo->addPackage($packageTwigBridge = $this->getPackage('symfony/twig-bridge', '2.0'));
$packageTwigBridge->setRequires(array(
new Link('symfony/twig-bridge', 'twig/twig', $this->getVersionConstraint('<', '2.0'), 'requires'),
));
$packageSymfony->setReplaces(array(
new Link('symfony/symfony', 'symfony/twig-bridge', $this->getVersionConstraint('==', '2.0'), 'replaces'),
));
$this->reposComplete();
$this->request->install('symfony/twig-bridge');
$this->request->install('twig/twig');
$this->checkSolverResult(array(
array('job' => 'install', 'package' => $packageTwig16),
array('job' => 'install', 'package' => $packageTwigBridge),
));
}
protected function reposComplete()
{
$this->pool->addRepository($this->repoInstalled);