Package options must be a non mandatory array and should be loaded when
existspull/2189/head
parent
28d0e08785
commit
8630aab93f
|
@ -193,6 +193,10 @@ class ArrayLoader implements LoaderInterface
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($config['options'])) {
|
||||
$package->setOptions($config['options']);
|
||||
}
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
|
|
|
@ -196,6 +196,7 @@ class ValidatingArrayLoader implements LoaderInterface
|
|||
// TODO validate package repositories' packages using this recursively
|
||||
|
||||
$this->validateFlatArray('include-path');
|
||||
$this->validateArray('options');
|
||||
|
||||
// branch alias validation
|
||||
if (isset($this->config['extra']['branch-alias'])) {
|
||||
|
|
|
@ -117,6 +117,7 @@ class ArrayLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
'archive' => array(
|
||||
'exclude' => array('/foo/bar', 'baz', '!/foo/bar/baz'),
|
||||
),
|
||||
'options' => array('ssl' => array('local_cert' => '/opt/certs/test.pem'))
|
||||
);
|
||||
|
||||
$package = $this->loader->load($config);
|
||||
|
|
|
@ -143,6 +143,7 @@ class ValidatingArrayLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
'bin/foo',
|
||||
'bin/bar',
|
||||
),
|
||||
'options' => array('ssl' => array('local_cert' => '/opt/certs/test.pem'))
|
||||
),
|
||||
),
|
||||
array( // test as array
|
||||
|
@ -256,6 +257,15 @@ class ValidatingArrayLoaderTest extends \PHPUnit_Framework_TestCase
|
|||
'autoload : invalid value (psr0), must be one of psr-0, classmap, files'
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'foo/bar',
|
||||
'options' => 'test',
|
||||
),
|
||||
array(
|
||||
'options : should be an array, string given'
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue