1
0
Fork 0

Merge pull request #316 from edorian/solver-update-tests

Some added update tests
pull/317/merge
Nils Adermann 2012-02-18 08:45:08 -08:00
commit 1dd15e5662
1 changed files with 34 additions and 0 deletions

View File

@ -158,6 +158,22 @@ class SolverTest extends TestCase
$this->checkSolverResult(array());
}
public function testSolverUpdateOnlyUpdatesSelectedPackage()
{
$this->repoInstalled->addPackage($packageA = $this->getPackage('A', '1.0'));
$this->repoInstalled->addPackage($packageB = $this->getPackage('B', '1.0'));
$this->repo->addPackage($packageAnewer = $this->getPackage('A', '1.1'));
$this->repo->addPackage($packageBnewer = $this->getPackage('B', '1.1'));
$this->reposComplete();
$this->request->update('A');
$this->checkSolverResult(array(
array('job' => 'update', 'from' => $packageA, 'to' => $packageAnewer),
));
}
public function testSolverUpdateConstrained()
{
$this->repoInstalled->addPackage($packageA = $this->getPackage('A', '1.0'));
@ -192,6 +208,24 @@ class SolverTest extends TestCase
)));
}
public function testSolverUpdateFullyConstrainedPrunesInstalledPackages()
{
$this->repoInstalled->addPackage($packageA = $this->getPackage('A', '1.0'));
$this->repoInstalled->addPackage($this->getPackage('B', '1.0'));
$this->repo->addPackage($newPackageA = $this->getPackage('A', '1.2'));
$this->repo->addPackage($this->getPackage('A', '2.0'));
$this->reposComplete();
$this->request->install('A', new VersionConstraint('<', '2.0.0.0'));
$this->request->update('A', new VersionConstraint('=', '1.0.0.0'));
$this->checkSolverResult(array(array(
'job' => 'update',
'from' => $packageA,
'to' => $newPackageA,
)));
}
public function testSolverAllJobs()
{
$this->repoInstalled->addPackage($packageD = $this->getPackage('D', '1.0'));