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

Turn obsolete relationships and replaced packages into conflict rules

This commit is contained in:
Nils Adermann 2011-08-20 18:19:47 -04:00
parent 52565a5935
commit f46aa495da
3 changed files with 194 additions and 16 deletions

View file

@ -73,6 +73,16 @@ class SolverTest extends \PHPUnit_Framework_TestCase
}
public function testSolverInstallInstalled()
{
$this->repoInstalled->addPackage(new MemoryPackage('A', '1.0'));
$this->reposComplete();
$this->request->install('A');
$this->checkSolverResult(array());
}
public function testSolverInstallInstalledWithAlternative()
{
$this->repo->addPackage(new MemoryPackage('A', '1.0'));
$this->repoInstalled->addPackage(new MemoryPackage('A', '1.0'));
@ -107,8 +117,6 @@ class SolverTest extends \PHPUnit_Framework_TestCase
public function testSolverUpdateSingle()
{
$this->markTestIncomplete();
$this->repoInstalled->addPackage($packageA = new MemoryPackage('A', '1.0'));
$this->repo->addPackage($newPackageA = new MemoryPackage('A', '1.1'));
$this->reposComplete();
@ -116,7 +124,9 @@ class SolverTest extends \PHPUnit_Framework_TestCase
$this->request->update('A');
$this->checkSolverResult(array(
array('job' => 'update', 'package' => $newPackageA),
//array('job' => 'update', 'from' => $packageA, 'to' => $newPackageA),
array('job' => 'remove', 'package' => $packageA),
array('job' => 'install', 'package' => $newPackageA),
));
}
@ -155,7 +165,7 @@ class SolverTest extends \PHPUnit_Framework_TestCase
array('job' => 'install', 'package' => $packageB),
array('job' => 'install', 'package' => $packageA),
array('job' => 'remove', 'package' => $packageD),
array('job' => 'update', 'package' => $packageC),
array('job' => 'update', 'from' => $oldPackageC, 'to' => $packageC),
));
}
@ -185,6 +195,11 @@ class SolverTest extends \PHPUnit_Framework_TestCase
protected function checkSolverResult(array $expected)
{
$result = $this->solver->solve($this->request);
foreach ($result as &$step) {
unset($step['why']);
}
$this->assertEquals($expected, $result);
}