mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
ExportInterface::getLabels should return a closure
This commit is contained in:
@@ -574,7 +574,15 @@ class ExportManagerTest extends KernelTestCase
|
||||
Argument::is(array(0, 1)),
|
||||
Argument::Type('array')
|
||||
)
|
||||
->willReturn(array( 1 => 1, 0 => 0));
|
||||
->willReturn(function($value) {
|
||||
switch($value) {
|
||||
case 0:
|
||||
case 1:
|
||||
return $value;
|
||||
default: throw new \RuntimeException(sprintf("The value %s is not valid", $value));
|
||||
}
|
||||
});
|
||||
|
||||
$export->getQueryKeys(Argument::Type('array'))->willReturn(array('export'));
|
||||
$export->getTitle()->willReturn('dummy title');
|
||||
$exportManager->addExport($export->reveal(), 'dummy');
|
||||
@@ -602,9 +610,14 @@ class ExportManagerTest extends KernelTestCase
|
||||
Argument::is(array('cat a', 'cat b')),
|
||||
Argument::is(array())
|
||||
)
|
||||
->willReturn(array(
|
||||
'cat a' => 'label cat a', 'cat b' => 'label cat b'
|
||||
));
|
||||
->willReturn(function($value) {
|
||||
switch ($value) {
|
||||
case 'cat a' : return 'label cat a';
|
||||
case 'cat b' : return 'label cat b';
|
||||
default:
|
||||
throw new \RuntimeException(sprintf("This value (%s) is not valid", $value));
|
||||
}
|
||||
});
|
||||
$aggregator->addRole()->willReturn(null);
|
||||
//$aggregator->addRole()->shouldBeCalled();
|
||||
$exportManager->addAggregator($aggregator->reveal(), 'aggregator_foo');
|
||||
|
Reference in New Issue
Block a user