Fix error handling for incorrect "repositories" array
parent
2a1a963b00
commit
3b678ee379
|
@ -124,7 +124,7 @@ class Config
|
||||||
}
|
}
|
||||||
|
|
||||||
// disable a repository with an anonymous {"name": false} repo
|
// disable a repository with an anonymous {"name": false} repo
|
||||||
if (1 === count($repository) && false === current($repository)) {
|
if (is_array($repository) && 1 === count($repository) && false === current($repository)) {
|
||||||
unset($this->repositories[key($repository)]);
|
unset($this->repositories[key($repository)]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,18 @@ class ConfigTest extends \PHPUnit_Framework_TestCase
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$data['incorrect local config does not cause ErrorException'] = array(
|
||||||
|
array(
|
||||||
|
'packagist' => array('type' => 'composer', 'url' => 'https?://packagist.org', 'allow_ssl_downgrade' => true),
|
||||||
|
'type' => 'vcs',
|
||||||
|
'url' => 'http://example.com',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'vcs',
|
||||||
|
'url' => 'http://example.com',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue