1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Merge branch 'master' into 2.0

This commit is contained in:
Jordi Boggiano 2020-01-14 15:39:35 +01:00
commit a5b178084c
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
20 changed files with 384 additions and 15 deletions

View file

@ -283,4 +283,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());
}
}