IcingaObject: fix rendering target and tests

This commit is contained in:
Thomas Gelf 2016-05-02 10:23:32 +02:00
parent bd937e57c5
commit 1158409eeb
3 changed files with 6 additions and 7 deletions

View File

@ -122,7 +122,6 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
return $this; return $this;
} }
private function loadMultiRelation($property) private function loadMultiRelation($property)
{ {
if ($this->hasBeenLoadedFromDb()) { if ($this->hasBeenLoadedFromDb()) {
@ -1129,7 +1128,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
} }
$config->configFile( $config->configFile(
'zones.d/' . $this->getRenderingZone($config) 'zones.d/' . $this->getRenderingZone($config) . '/' . $filename
)->addObject($this); )->addObject($this);
} }

View File

@ -284,7 +284,7 @@ class IcingaHostTest extends BaseTestCase
$config = new IcingaConfig($db); $config = new IcingaConfig($db);
$host->renderToConfig($config); $host->renderToConfig($config);
$this->assertEquals( $this->assertEquals(
array('zones.d/master.conf'), array('zones.d/master/hosts.conf'),
$config->getFileNames() $config->getFileNames()
); );
@ -295,7 +295,7 @@ class IcingaHostTest extends BaseTestCase
$host->zone = '___TEST___zone'; $host->zone = '___TEST___zone';
$host->renderToConfig($config); $host->renderToConfig($config);
$this->assertEquals( $this->assertEquals(
array('zones.d/___TEST___zone.conf'), array('zones.d/___TEST___zone/hosts.conf'),
$config->getFileNames() $config->getFileNames()
); );
@ -306,7 +306,7 @@ class IcingaHostTest extends BaseTestCase
$config = new IcingaConfig($db); $config = new IcingaConfig($db);
$host->renderToConfig($config); $host->renderToConfig($config);
$this->assertEquals( $this->assertEquals(
array('zones.d/___TEST___zone.conf'), array('zones.d/___TEST___zone/hosts.conf'),
$config->getFileNames() $config->getFileNames()
); );
@ -316,7 +316,7 @@ class IcingaHostTest extends BaseTestCase
$config = new IcingaConfig($db); $config = new IcingaConfig($db);
$host->renderToConfig($config); $host->renderToConfig($config);
$this->assertEquals( $this->assertEquals(
array('zones.d/director-global.conf'), array('zones.d/director-global/host_templates.conf'),
$config->getFileNames() $config->getFileNames()
); );

View File

@ -204,7 +204,7 @@ class IcingaServiceTest extends BaseTestCase
$config = new IcingaConfig($db); $config = new IcingaConfig($db);
$service->renderToConfig($config); $service->renderToConfig($config);
$this->assertEquals( $this->assertEquals(
array('zones.d/master.conf'), array('zones.d/master/services.conf'),
$config->getFileNames() $config->getFileNames()
); );
} }