Use a subclass of Icinga\Application\Config to preset a module config

Implementing methods for just tests is discouraged
This commit is contained in:
Johannes Meyer 2014-11-06 10:07:57 +01:00
parent f6595267d6
commit f8724c504b
1 changed files with 11 additions and 2 deletions

View File

@ -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'