1
0
Fork 0

Add test for correct sorting when force installing deps

pull/770/head
Nils Adermann 2012-06-04 23:30:55 +02:00
parent 26e051cb76
commit a7f1605cdf
1 changed files with 27 additions and 0 deletions

View File

@ -118,6 +118,33 @@ class SolverTest extends TestCase
)); ));
} }
public function testSolverInstallWithDepsInOrder()
{
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
$this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
$this->repo->addPackage($packageC = $this->getPackage('C', '1.0'));
$packageB->setRequires(array(
new Link('B', 'A', $this->getVersionConstraint('>=', '1.0'), 'requires'),
new Link('B', 'C', $this->getVersionConstraint('>=', '1.0'), 'requires'),
));
$packageC->setRequires(array(
new Link('C', 'A', $this->getVersionConstraint('>=', '1.0'), 'requires'),
));
$this->reposComplete();
$this->request->install('A');
$this->request->install('B');
$this->request->install('C');
$this->checkSolverResult(array(
array('job' => 'install', 'package' => $packageA),
array('job' => 'install', 'package' => $packageC),
array('job' => 'install', 'package' => $packageB),
));
}
public function testSolverInstallInstalled() public function testSolverInstallInstalled()
{ {
$this->repoInstalled->addPackage($this->getPackage('A', '1.0')); $this->repoInstalled->addPackage($this->getPackage('A', '1.0'));