Simplify testSolverWithComposerRepo reusing utility methods from other tests
parent
0d30bc469b
commit
01945c20f9
|
@ -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()
|
protected function reposComplete()
|
||||||
{
|
{
|
||||||
$this->pool->addRepository($this->repoInstalled);
|
$this->pool->addRepository($this->repoInstalled);
|
||||||
|
@ -173,31 +190,4 @@ class SolverTest extends \PHPUnit_Framework_TestCase
|
||||||
$this->assertEquals($expected, $result);
|
$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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue