mirror of
https://github.com/composer/composer
synced 2025-05-09 16:42:57 +00:00
Simplify testSolverWithComposerRepo reusing utility methods from other tests
This commit is contained in:
parent
0d30bc469b
commit
01945c20f9
1 changed files with 17 additions and 27 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue