mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Internalize pool creation in repository set, store root aliases in set
The pool is still exposed too early in a few places which will require further refactoring
This commit is contained in:
parent
6ef65e5319
commit
1228bcdffc
17 changed files with 248 additions and 133 deletions
|
@ -142,11 +142,6 @@ class ComposerRepositoryTest extends TestCase
|
|||
),
|
||||
)));
|
||||
|
||||
$pool = $this->getMockBuilder('Composer\DependencyResolver\Pool')->getMock();
|
||||
$pool->expects($this->any())
|
||||
->method('isPackageAcceptable')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
$versionParser = new VersionParser();
|
||||
$repo->setRootAliases(array(
|
||||
'a' => array(
|
||||
|
@ -155,7 +150,7 @@ class ComposerRepositoryTest extends TestCase
|
|||
),
|
||||
));
|
||||
|
||||
$packages = $repo->whatProvides($pool, 'a');
|
||||
$packages = $repo->whatProvides('a', false, array($this, 'isPackageAcceptableReturnTrue'));
|
||||
|
||||
$this->assertCount(7, $packages);
|
||||
$this->assertEquals(array('1', '1-alias', '2', '2-alias', '2-root', '3', '3-root'), array_keys($packages));
|
||||
|
@ -164,6 +159,11 @@ class ComposerRepositoryTest extends TestCase
|
|||
$this->assertSame($packages['2'], $packages['2-alias']->getAliasOf());
|
||||
}
|
||||
|
||||
public function isPackageAcceptableReturnTrue()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function testSearchWithType()
|
||||
{
|
||||
$repoConfig = array(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue