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

[Config command] allow to pass options when adding a repo

This commit is contained in:
Bilal Amarni 2016-01-22 11:08:00 +01:00
parent 06a21132db
commit e727f9f5fe
4 changed files with 51 additions and 3 deletions

View file

@ -52,6 +52,24 @@ class JsonConfigSourceTest extends \PHPUnit_Framework_TestCase
$this->assertFileEquals($this->fixturePath('config/config-with-exampletld-repository.json'), $config);
}
public function testAddRepositoryWithOptions()
{
$config = $this->workingDir.'/composer.json';
copy($this->fixturePath('composer-repositories.json'), $config);
$jsonConfigSource = new JsonConfigSource(new JsonFile($config));
$jsonConfigSource->addRepository('example_tld', array(
'type' => 'composer',
'url' => 'https://example.tld',
'options' => array(
'ssl' => array(
'local_cert' => '/home/composer/.ssl/composer.pem'
)
)
));
$this->assertFileEquals($this->fixturePath('config/config-with-exampletld-repository-and-options.json'), $config);
}
public function testRemoveRepository()
{
$config = $this->workingDir.'/composer.json';