mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Create project: add option to add the repository to the composer.json
This commit is contained in:
parent
fb93036a70
commit
2a564a9f36
4 changed files with 55 additions and 6 deletions
|
@ -46,4 +46,24 @@ class RepositoryFactoryTest extends TestCase
|
|||
'path',
|
||||
), array_keys($repositoryClasses));
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider generateRepositoryNameProvider
|
||||
*/
|
||||
public function testGenerateRepositoryName($index, array $config, array $existingRepos, $expected)
|
||||
{
|
||||
$this->assertSame($expected, RepositoryFactory::generateRepositoryName($index, $config, $existingRepos));
|
||||
}
|
||||
|
||||
public function generateRepositoryNameProvider()
|
||||
{
|
||||
return array(
|
||||
array(0, array(), array(), 0),
|
||||
array(0, array(), array(array()), '02'),
|
||||
array(0, array('url' => 'https://example.org'), array(), 'example.org'),
|
||||
array(0, array('url' => 'https://example.org'), array('example.org' => array()), 'example.org2'),
|
||||
array('example.org', array('url' => 'https://example.org/repository'), array(), 'example.org'),
|
||||
array('example.org', array('url' => 'https://example.org/repository'), array('example.org' => array()), 'example.org2'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue