Merge branch '1.9'
commit
a902279a5b
|
@ -249,6 +249,14 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
||||||
$this->loadProviderListings($this->loadRootServerFile());
|
$this->loadProviderListings($this->loadRootServerFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->hasPartialPackages) {
|
||||||
|
if (null === $this->partialPackagesByName) {
|
||||||
|
$this->initializePartialPackages();
|
||||||
|
}
|
||||||
|
|
||||||
|
return array_keys($this->partialPackagesByName);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->lazyProvidersUrl) {
|
if ($this->lazyProvidersUrl) {
|
||||||
// Can not determine list of provided packages for lazy repositories
|
// Can not determine list of provided packages for lazy repositories
|
||||||
return array();
|
return array();
|
||||||
|
|
|
@ -271,4 +271,33 @@ class ComposerRepositoryTest extends TestCase
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testGetProviderNamesWillReturnPartialPackageNames()
|
||||||
|
{
|
||||||
|
$rfs = $this->getMockBuilder('Composer\Util\RemoteFilesystem')
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->getMock();
|
||||||
|
|
||||||
|
$rfs->expects($this->at(0))
|
||||||
|
->method('getContents')
|
||||||
|
->with('example.org', 'http://example.org/packages.json', false)
|
||||||
|
->willReturn(json_encode(array(
|
||||||
|
'providers-lazy-url' => '/foo/p/%package%.json',
|
||||||
|
'packages' => array('foo/bar' => array(
|
||||||
|
'dev-branch' => array(),
|
||||||
|
'v1.0.0' => array(),
|
||||||
|
))
|
||||||
|
)));
|
||||||
|
|
||||||
|
$repository = new ComposerRepository(
|
||||||
|
array('url' => 'http://example.org/packages.json'),
|
||||||
|
new NullIO(),
|
||||||
|
FactoryMock::createConfig(),
|
||||||
|
null,
|
||||||
|
$rfs
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->assertTrue($repository->hasProviders());
|
||||||
|
$this->assertEquals(array('foo/bar'), $repository->getProviderNames());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue