Use a subclass of Icinga\Application\Config to preset a module config
Implementing methods for just tests is discouraged
This commit is contained in:
parent
f6595267d6
commit
f8724c504b
|
@ -10,7 +10,16 @@ use Icinga\Application\Config;
|
|||
use Icinga\Module\Monitoring\Backend;
|
||||
use Icinga\Test\BaseTestCase;
|
||||
use Mockery;
|
||||
use Zend_Config;
|
||||
|
||||
|
||||
class ConfigWithSetModuleConfig extends Config
|
||||
{
|
||||
public static function setModuleConfig($moduleName, $configName, $config)
|
||||
{
|
||||
static::$modules[$moduleName][$configName] = $config;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class Bug7043Test extends BaseTestCase
|
||||
{
|
||||
|
@ -36,7 +45,7 @@ class Bug7043Test extends BaseTestCase
|
|||
->getMock()
|
||||
);
|
||||
|
||||
Config::setModuleConfig('monitoring', 'backends', new Zend_Config(array(
|
||||
ConfigWithSetModuleConfig::setModuleConfig('monitoring', 'backends', new Config(array(
|
||||
'backendName' => array(
|
||||
'type' => 'ido',
|
||||
'resource' => 'ido'
|
||||
|
|
Loading…
Reference in New Issue