|
@@ -19,6 +19,7 @@ use Composer\DependencyResolver\DefaultPolicy;
|
|
|
use Composer\DependencyResolver\Pool;
|
|
|
use Composer\DependencyResolver\Request;
|
|
|
use Composer\DependencyResolver\Solver;
|
|
|
+use Composer\DependencyResolver\SolverProblemsException;
|
|
|
use Composer\Package\Link;
|
|
|
use Composer\Package\LinkConstraint\VersionConstraint;
|
|
|
use Composer\Test\TestCase;
|
|
@@ -54,13 +55,30 @@ class SolverTest extends TestCase
|
|
|
));
|
|
|
}
|
|
|
|
|
|
+ public function testInstallNonExistingPackageFails()
|
|
|
+ {
|
|
|
+ $this->markTestIncomplete('Reporting this failure is not implemented/working yet');
|
|
|
+
|
|
|
+ $this->repo->addPackage($this->getPackage('A', '1.0'));
|
|
|
+ $this->reposComplete();
|
|
|
+
|
|
|
+ $this->request->install('B');
|
|
|
+
|
|
|
+ try {
|
|
|
+ $transaction = $this->solver->solve($this->request);
|
|
|
+ $this->fail('Unsolvable conflict did not resolve in exception.');
|
|
|
+ } catch (SolverProblemsException $e) {
|
|
|
+ // TODO assert problem properties
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function testSolverInstallWithDeps()
|
|
|
{
|
|
|
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
$this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
|
|
|
$this->repo->addPackage($newPackageB = $this->getPackage('B', '1.1'));
|
|
|
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('<', '1.1'), 'requires')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('<', '1.1'), 'requires')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -122,12 +140,12 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($newPackageB = $this->getPackage('B', '1.1'));
|
|
|
$this->reposComplete();
|
|
|
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0.0.0'), 'requires')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '1.0.0.0'), 'requires')));
|
|
|
|
|
|
- $this->request->install('A', new VersionConstraint('=', '1.0.0.0'));
|
|
|
- $this->request->install('B', new VersionConstraint('=', '1.1.0.0'));
|
|
|
- $this->request->update('A', new VersionConstraint('=', '1.0.0.0'));
|
|
|
- $this->request->update('B', new VersionConstraint('=', '1.0.0.0'));
|
|
|
+ $this->request->install('A', $this->getVersionConstraint('=', '1.0.0.0'));
|
|
|
+ $this->request->install('B', $this->getVersionConstraint('=', '1.1.0.0'));
|
|
|
+ $this->request->update('A', $this->getVersionConstraint('=', '1.0.0.0'));
|
|
|
+ $this->request->update('B', $this->getVersionConstraint('=', '1.0.0.0'));
|
|
|
|
|
|
$this->checkSolverResult(array(
|
|
|
array('job' => 'update', 'from' => $packageB, 'to' => $newPackageB),
|
|
@@ -147,6 +165,26 @@ class SolverTest extends TestCase
|
|
|
));
|
|
|
}
|
|
|
|
|
|
+ public function testSolverUpdateAll()
|
|
|
+ {
|
|
|
+ $this->repoInstalled->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
+ $this->repoInstalled->addPackage($packageB = $this->getPackage('B', '1.0'));
|
|
|
+ $this->repo->addPackage($newPackageA = $this->getPackage('A', '1.1'));
|
|
|
+ $this->repo->addPackage($newPackageB = $this->getPackage('B', '1.1'));
|
|
|
+
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', null, 'requires')));
|
|
|
+
|
|
|
+ $this->reposComplete();
|
|
|
+
|
|
|
+ $this->request->install('A');
|
|
|
+ $this->request->updateAll();
|
|
|
+
|
|
|
+ $this->checkSolverResult(array(
|
|
|
+ array('job' => 'update', 'from' => $packageB, 'to' => $newPackageB),
|
|
|
+ array('job' => 'update', 'from' => $packageA, 'to' => $newPackageA),
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
public function testSolverUpdateCurrent()
|
|
|
{
|
|
|
$this->repoInstalled->addPackage($this->getPackage('A', '1.0'));
|
|
@@ -158,6 +196,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'));
|
|
@@ -165,7 +219,7 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($this->getPackage('A', '2.0'));
|
|
|
$this->reposComplete();
|
|
|
|
|
|
- $this->request->install('A', new VersionConstraint('<', '2.0.0.0'));
|
|
|
+ $this->request->install('A', $this->getVersionConstraint('<', '2.0.0.0'));
|
|
|
$this->request->update('A');
|
|
|
|
|
|
$this->checkSolverResult(array(array(
|
|
@@ -182,8 +236,26 @@ class SolverTest extends TestCase
|
|
|
$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->request->install('A', $this->getVersionConstraint('<', '2.0.0.0'));
|
|
|
+ $this->request->update('A', $this->getVersionConstraint('=', '1.0.0.0'));
|
|
|
+
|
|
|
+ $this->checkSolverResult(array(array(
|
|
|
+ 'job' => 'update',
|
|
|
+ 'from' => $packageA,
|
|
|
+ 'to' => $newPackageA,
|
|
|
+ )));
|
|
|
+ }
|
|
|
+
|
|
|
+ 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', $this->getVersionConstraint('<', '2.0.0.0'));
|
|
|
+ $this->request->update('A', $this->getVersionConstraint('=', '1.0.0.0'));
|
|
|
|
|
|
$this->checkSolverResult(array(array(
|
|
|
'job' => 'update',
|
|
@@ -202,7 +274,7 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($newPackageB = $this->getPackage('B', '1.1'));
|
|
|
$this->repo->addPackage($packageC = $this->getPackage('C', '1.1'));
|
|
|
$this->repo->addPackage($this->getPackage('D', '1.0'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('<', '1.1'), 'requires')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('<', '1.1'), 'requires')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -224,8 +296,8 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($middlePackageB = $this->getPackage('B', '1.0'));
|
|
|
$this->repo->addPackage($newPackageB = $this->getPackage('B', '1.1'));
|
|
|
$this->repo->addPackage($oldPackageB = $this->getPackage('B', '0.9'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('<', '1.1'), 'requires')));
|
|
|
- $packageA->setConflicts(array(new Link('A', 'B', new VersionConstraint('<', '1.0'), 'conflicts')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('<', '1.1'), 'requires')));
|
|
|
+ $packageA->setConflicts(array(new Link('A', 'B', $this->getVersionConstraint('<', '1.0'), 'conflicts')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -271,8 +343,8 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
$this->repo->addPackage($packageQ = $this->getPackage('Q', '1.0'));
|
|
|
$this->repo->addPackage($packageB = $this->getPackage('B', '0.8'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
- $packageQ->setProvides(array(new Link('Q', 'B', new VersionConstraint('=', '1.0'), 'provides')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageQ->setProvides(array(new Link('Q', 'B', $this->getVersionConstraint('=', '1.0'), 'provides')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -289,8 +361,8 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
$this->repo->addPackage($packageQ = $this->getPackage('Q', '1.0'));
|
|
|
$this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
- $packageQ->setReplaces(array(new Link('Q', 'B', new VersionConstraint('>=', '1.0'), 'replaces')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageQ->setReplaces(array(new Link('Q', 'B', $this->getVersionConstraint('>=', '1.0'), 'replaces')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -306,8 +378,8 @@ class SolverTest extends TestCase
|
|
|
{
|
|
|
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
$this->repo->addPackage($packageQ = $this->getPackage('Q', '1.0'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
- $packageQ->setReplaces(array(new Link('Q', 'B', new VersionConstraint('>=', '1.0'), 'replaces')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageQ->setReplaces(array(new Link('Q', 'B', $this->getVersionConstraint('>=', '1.0'), 'replaces')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -324,8 +396,8 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
$this->repo->addPackage($packageQ = $this->getPackage('Q', '1.0'));
|
|
|
$this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
- $packageQ->setReplaces(array(new Link('Q', 'B', new VersionConstraint('>=', '1.0'), 'replaces')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageQ->setReplaces(array(new Link('Q', 'B', $this->getVersionConstraint('>=', '1.0'), 'replaces')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -342,24 +414,24 @@ class SolverTest extends TestCase
|
|
|
{
|
|
|
$this->repo->addPackage($packageX = $this->getPackage('X', '1.0'));
|
|
|
$packageX->setRequires(array(
|
|
|
- new Link('X', 'A', new VersionConstraint('>=', '2.0.0.0'), 'requires'),
|
|
|
- new Link('X', 'B', new VersionConstraint('>=', '2.0.0.0'), 'requires')));
|
|
|
+ new Link('X', 'A', $this->getVersionConstraint('>=', '2.0.0.0'), 'requires'),
|
|
|
+ new Link('X', 'B', $this->getVersionConstraint('>=', '2.0.0.0'), 'requires')));
|
|
|
|
|
|
$this->repo->addPackage($packageA = $this->getPackage('A', '2.0.0'));
|
|
|
$this->repo->addPackage($newPackageA = $this->getPackage('A', '2.1.0'));
|
|
|
$this->repo->addPackage($newPackageB = $this->getPackage('B', '2.1.0'));
|
|
|
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '2.0.0.0'), 'requires')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '2.0.0.0'), 'requires')));
|
|
|
|
|
|
// new package A depends on version of package B that does not exist
|
|
|
// => new package A is not installable
|
|
|
- $newPackageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '2.2.0.0'), 'requires')));
|
|
|
+ $newPackageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '2.2.0.0'), 'requires')));
|
|
|
|
|
|
// add a package S replacing both A and B, so that S and B or S and A cannot be simultaneously installed
|
|
|
// but an alternative option for A and B both exists
|
|
|
// this creates a more difficult so solve conflict
|
|
|
$this->repo->addPackage($packageS = $this->getPackage('S', '2.0.0'));
|
|
|
- $packageS->setReplaces(array(new Link('S', 'A', new VersionConstraint('>=', '2.0.0.0'), 'replaces'), new Link('S', 'B', new VersionConstraint('>=', '2.0.0.0'), 'replaces')));
|
|
|
+ $packageS->setReplaces(array(new Link('S', 'A', $this->getVersionConstraint('>=', '2.0.0.0'), 'replaces'), new Link('S', 'B', $this->getVersionConstraint('>=', '2.0.0.0'), 'replaces')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -377,8 +449,8 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
$this->repo->addPackage($packageB1 = $this->getPackage('B', '0.9'));
|
|
|
$this->repo->addPackage($packageB2 = $this->getPackage('B', '1.1'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
- $packageB2->setRequires(array(new Link('B', 'A', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageB2->setRequires(array(new Link('B', 'A', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -398,10 +470,10 @@ class SolverTest extends TestCase
|
|
|
$this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
|
|
|
$this->repo->addPackage($packageC = $this->getPackage('C', '1.0'));
|
|
|
$this->repo->addPackage($packageD = $this->getPackage('D', '1.0'));
|
|
|
- $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
- $packageB->setRequires(array(new Link('B', 'Virtual', new VersionConstraint('>=', '1.0'), 'requires')));
|
|
|
- $packageC->setRequires(array(new Link('C', 'Virtual', new VersionConstraint('==', '1.0'), 'provides')));
|
|
|
- $packageD->setRequires(array(new Link('D', 'Virtual', new VersionConstraint('==', '1.0'), 'provides')));
|
|
|
+ $packageA->setRequires(array(new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageB->setRequires(array(new Link('B', 'Virtual', $this->getVersionConstraint('>=', '1.0'), 'requires')));
|
|
|
+ $packageC->setRequires(array(new Link('C', 'Virtual', $this->getVersionConstraint('==', '1.0'), 'provides')));
|
|
|
+ $packageD->setRequires(array(new Link('D', 'Virtual', $this->getVersionConstraint('==', '1.0'), 'provides')));
|
|
|
|
|
|
$this->reposComplete();
|
|
|
|
|
@@ -414,6 +486,119 @@ class SolverTest extends TestCase
|
|
|
));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * If a replacer D replaces B and C with C not otherwise available,
|
|
|
+ * D must be installed instead of the original B.
|
|
|
+ */
|
|
|
+ public function testUseReplacerIfNecessary()
|
|
|
+ {
|
|
|
+ $this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
+ $this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
|
|
|
+ $this->repo->addPackage($packageD = $this->getPackage('D', '1.0'));
|
|
|
+ $this->repo->addPackage($packageD2 = $this->getPackage('D', '1.1'));
|
|
|
+
|
|
|
+ $packageA->setRequires(array(
|
|
|
+ new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'requires'),
|
|
|
+ new Link('A', 'C', $this->getVersionConstraint('>=', '1.0'), 'requires'),
|
|
|
+ ));
|
|
|
+
|
|
|
+ $packageD->setReplaces(array(
|
|
|
+ new Link('D', 'B', $this->getVersionConstraint('>=', '1.0'), 'replaces'),
|
|
|
+ new Link('D', 'C', $this->getVersionConstraint('>=', '1.0'), 'replaces'),
|
|
|
+ ));
|
|
|
+
|
|
|
+ $packageD2->setReplaces(array(
|
|
|
+ new Link('D', 'B', $this->getVersionConstraint('>=', '1.0'), 'replaces'),
|
|
|
+ new Link('D', 'C', $this->getVersionConstraint('>=', '1.0'), 'replaces'),
|
|
|
+ ));
|
|
|
+
|
|
|
+ $this->reposComplete();
|
|
|
+
|
|
|
+ $this->request->install('A');
|
|
|
+
|
|
|
+ $this->checkSolverResult(array(
|
|
|
+ array('job' => 'install', 'package' => $packageD2),
|
|
|
+ array('job' => 'install', 'package' => $packageA),
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ public function testIssue265()
|
|
|
+ {
|
|
|
+ $this->repo->addPackage($packageA1 = $this->getPackage('A', '2.0.999999-dev'));
|
|
|
+ $this->repo->addPackage($packageA2 = $this->getPackage('A', '2.1-dev'));
|
|
|
+ $this->repo->addPackage($packageA3 = $this->getPackage('A', '2.2-dev'));
|
|
|
+ $this->repo->addPackage($packageB1 = $this->getPackage('B', '2.0.10'));
|
|
|
+ $this->repo->addPackage($packageB2 = $this->getPackage('B', '2.0.9'));
|
|
|
+ $this->repo->addPackage($packageC = $this->getPackage('C', '2.0-dev'));
|
|
|
+ $this->repo->addPackage($packageD = $this->getPackage('D', '2.0.9'));
|
|
|
+
|
|
|
+ $packageC->setRequires(array(
|
|
|
+ new Link('C', 'A', $this->getVersionConstraint('>=', '2.0'), 'requires'),
|
|
|
+ new Link('C', 'D', $this->getVersionConstraint('>=', '2.0'), 'requires'),
|
|
|
+ ));
|
|
|
+
|
|
|
+ $packageD->setRequires(array(
|
|
|
+ new Link('D', 'A', $this->getVersionConstraint('>=', '2.1'), 'requires'),
|
|
|
+ new Link('D', 'B', $this->getVersionConstraint('>=', '2.0-dev'), 'requires'),
|
|
|
+ ));
|
|
|
+
|
|
|
+ $packageB1->setRequires(array(new Link('B', 'A', $this->getVersionConstraint('==', '2.1.0.0-dev'), 'requires')));
|
|
|
+ $packageB2->setRequires(array(new Link('B', 'A', $this->getVersionConstraint('==', '2.1.0.0-dev'), 'requires')));
|
|
|
+
|
|
|
+ $packageB2->setReplaces(array(new Link('B', 'D', $this->getVersionConstraint('==', '2.0.9.0'), 'replaces')));
|
|
|
+
|
|
|
+ $this->reposComplete();
|
|
|
+
|
|
|
+ $this->request->install('C', $this->getVersionConstraint('==', '2.0.0.0-dev'));
|
|
|
+
|
|
|
+ $this->setExpectedException('Composer\DependencyResolver\SolverProblemsException');
|
|
|
+
|
|
|
+ $this->solver->solve($this->request);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function testConflictResultEmpty()
|
|
|
+ {
|
|
|
+ $this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
+ $this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));;
|
|
|
+
|
|
|
+ $packageA->setConflicts(array(
|
|
|
+ new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'conflicts'),
|
|
|
+ ));
|
|
|
+
|
|
|
+ $this->reposComplete();
|
|
|
+
|
|
|
+ $this->request->install('A');
|
|
|
+ $this->request->install('B');
|
|
|
+
|
|
|
+ try {
|
|
|
+ $transaction = $this->solver->solve($this->request);
|
|
|
+ $this->fail('Unsolvable conflict did not resolve in exception.');
|
|
|
+ } catch (SolverProblemsException $e) {
|
|
|
+ // TODO assert problem properties
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public function testUnsatisfiableRequires()
|
|
|
+ {
|
|
|
+ $this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
|
|
+ $this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
|
|
|
+
|
|
|
+ $packageA->setRequires(array(
|
|
|
+ new Link('A', 'B', $this->getVersionConstraint('>=', '2.0'), 'requires'),
|
|
|
+ ));
|
|
|
+
|
|
|
+ $this->reposComplete();
|
|
|
+
|
|
|
+ $this->request->install('A');
|
|
|
+
|
|
|
+ try {
|
|
|
+ $transaction = $this->solver->solve($this->request);
|
|
|
+ $this->fail('Unsolvable conflict did not resolve in exception.');
|
|
|
+ } catch (SolverProblemsException $e) {
|
|
|
+ // TODO assert problem properties
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
protected function reposComplete()
|
|
|
{
|
|
|
$this->pool->addRepository($this->repoInstalled);
|
|
@@ -443,5 +628,4 @@ class SolverTest extends TestCase
|
|
|
|
|
|
$this->assertEquals($expected, $result);
|
|
|
}
|
|
|
-
|
|
|
}
|