From 01945c20f9bf25848496da146a74a9a70956483a Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 5 Aug 2011 04:17:07 -0400 Subject: [PATCH] Simplify testSolverWithComposerRepo reusing utility methods from other tests --- .../Test/DependencyResolver/SolverTest.php | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index e18d93094..eab904b5b 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -161,6 +161,23 @@ class SolverTest extends \PHPUnit_Framework_TestCase )); } + public function testSolverWithComposerRepo() + { + $this->markTestIncomplete(); + + $this->repoInstalled = new PlatformRepository; + $this->repo = new ComposerRepository('http://packagist.org'); + list($monolog) = $this->repo->getPackages(); + + $this->reposComplete(); + + $this->request->install('Monolog'); + + $this->checkSolverResult(array( + array('job' => 'install', 'package' => $monolog), + )); + } + protected function reposComplete() { $this->pool->addRepository($this->repoInstalled); @@ -173,31 +190,4 @@ class SolverTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expected, $result); } - public function testSolverWithComposerRepo() - { - $pool = new Pool; - $repoInstalled = new PlatformRepository; - $repo = new ComposerRepository('http://packagist.org'); - list($monolog) = $repo->getPackages(); - - $pool->addRepository($repoInstalled); - $pool->addRepository($repo); - - $request = new Request($pool); - - $request->install('Monolog'); - - $policy = new DefaultPolicy; - $solver = new Solver($policy, $pool, $repoInstalled); - $result = $solver->solve($request); - - $expected = array( - array( - 'job' => 'install', - 'package' => $monolog, - ), - ); - - $this->assertEquals($expected, $result); - } }