Skip to content

Commit

Permalink
Use a subclass of Icinga\Application\Config to preset a module config
Browse files Browse the repository at this point in the history
Implementing methods for just tests is discouraged
  • Loading branch information
Johannes Meyer committed Nov 6, 2014
1 parent f659526 commit f8724c5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/monitoring/test/php/regression/Bug7043Test.php
Expand Up @@ -10,7 +10,16 @@
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
{
Expand All @@ -36,7 +45,7 @@ public function testBackendDefaultName()
->getMock()
);

Config::setModuleConfig('monitoring', 'backends', new Zend_Config(array(
ConfigWithSetModuleConfig::setModuleConfig('monitoring', 'backends', new Config(array(
'backendName' => array(
'type' => 'ido',
'resource' => 'ido'
Expand Down

0 comments on commit f8724c5

Please sign in to comment.