mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
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\Module\Monitoring\Backend;
|
||||||
use Icinga\Test\BaseTestCase;
|
use Icinga\Test\BaseTestCase;
|
||||||
use Mockery;
|
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
|
class Bug7043Test extends BaseTestCase
|
||||||
{
|
{
|
||||||
@ -36,7 +45,7 @@ class Bug7043Test extends BaseTestCase
|
|||||||
->getMock()
|
->getMock()
|
||||||
);
|
);
|
||||||
|
|
||||||
Config::setModuleConfig('monitoring', 'backends', new Zend_Config(array(
|
ConfigWithSetModuleConfig::setModuleConfig('monitoring', 'backends', new Config(array(
|
||||||
'backendName' => array(
|
'backendName' => array(
|
||||||
'type' => 'ido',
|
'type' => 'ido',
|
||||||
'resource' => 'ido'
|
'resource' => 'ido'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user