1
0
Fork 0

Simplify testSolverWithComposerRepo reusing utility methods from other tests

pull/9/head
Nils Adermann 2011-08-05 04:17:07 -04:00
parent 0d30bc469b
commit 01945c20f9
1 changed files with 17 additions and 27 deletions

View File

@ -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);
}
}