protected function getConfigProviderMock()
{
$options = $this->options ?: $this->defaultOptions;
$mock = $this->getMock('eZ\\Publish\\Core\\MVC\\ConfigResolverInterface');
$mock->expects($this->any())->method('hasParameter')->will($this->returnCallback(function ($parameterName) use($options) {
return isset($options[$parameterName]);
}));
$mock->expects($this->any())->method('getParameter')->will($this->returnCallback(function ($parameterName, $defaultValue) use($options) {
return isset($options[$parameterName]) ? $options[$parameterName] : $defaultValue;
}));
return $mock;
}