From ac61c3973b7c1a50f037a4c15a3a10013e4a94ce Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 20 Aug 2011 23:05:11 -0400 Subject: [PATCH] Add a test for two equivalent installable packages and fix the functional test --- .../Test/DependencyResolver/SolverTest.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index 85d46a72f..3a4d1b68b 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -165,11 +165,27 @@ class SolverTest extends \PHPUnit_Framework_TestCase )); } + public function testInstallOneOfTwoAlternatives() + { + $this->repo->addPackage($packageA = new MemoryPackage('A', '1.0')); + $this->repo->addPackage($packageB = new MemoryPackage('A', '1.0')); + + $this->reposComplete(); + + $this->request->install('A'); + + $this->checkSolverResult(array( + array('job' => 'install', 'package' => $packageA), + )); + } + public function testSolverWithComposerRepo() { - $this->markTestIncomplete(); - $this->repoInstalled = new PlatformRepository; + + // overwrite solver with custom installed repo + $this->solver = new Solver($this->policy, $this->pool, $this->repoInstalled); + $this->repo = new ComposerRepository('http://packagist.org'); list($monolog) = $this->repo->getPackages();