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

Fix/add tests and also handle case where a json object is used

This commit is contained in:
Jordi Boggiano 2021-02-11 11:13:58 +01:00
parent 4130d388fe
commit 52d7c6c383
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
2 changed files with 27 additions and 8 deletions

View file

@ -35,7 +35,7 @@ class ConfigTest extends TestCase
$data = array();
$data['local config inherits system defaults'] = array(
array(
'packagist.org' => array('type' => 'composer', 'url' => 'https?://repo.packagist.org', 'allow_ssl_downgrade' => true),
'packagist.org' => array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
),
array(),
);
@ -58,7 +58,7 @@ class ConfigTest extends TestCase
array(
1 => array('type' => 'vcs', 'url' => 'git://github.com/composer/composer.git'),
0 => array('type' => 'pear', 'url' => 'http://pear.composer.org'),
'packagist.org' => array('type' => 'composer', 'url' => 'https?://repo.packagist.org', 'allow_ssl_downgrade' => true),
'packagist.org' => array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
),
array(
array('type' => 'vcs', 'url' => 'git://github.com/composer/composer.git'),
@ -69,7 +69,7 @@ class ConfigTest extends TestCase
$data['system config adds above core defaults'] = array(
array(
'example.com' => array('type' => 'composer', 'url' => 'http://example.com'),
'packagist.org' => array('type' => 'composer', 'url' => 'https?://repo.packagist.org', 'allow_ssl_downgrade' => true),
'packagist.org' => array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
),
array(),
array(
@ -104,9 +104,27 @@ class ConfigTest extends TestCase
),
);
$data['local config redefining packagist.org by URL override it if no named keys are used'] = array(
array(
array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
),
array(
array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
),
);
$data['local config redefining packagist.org by URL override it also with named keys'] = array(
array(
'example' => array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
),
array(
'example' => array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
),
);
$data['incorrect local config does not cause ErrorException'] = array(
array(
'packagist.org' => array('type' => 'composer', 'url' => 'https?://repo.packagist.org', 'allow_ssl_downgrade' => true),
'packagist.org' => array('type' => 'composer', 'url' => 'https://repo.packagist.org'),
'type' => 'vcs',
'url' => 'http://example.com',
),