IcingaServiceTest: no need to store when setting...

...a connection
This commit is contained in:
Thomas Gelf 2016-10-22 06:37:22 +00:00
parent 5d693debeb
commit 4c9de0fa34

View File

@ -244,15 +244,13 @@ class IcingaServiceTest extends BaseTestCase
$db = $this->getDb(); $db = $this->getDb();
$service = $this->service('___TEST___service_$not_replaced$'); $service = $this->service('___TEST___service_$not_replaced$');
$service->setConnection($db);
$service->object_type = 'apply'; $service->object_type = 'apply';
$service->display_name = 'Service: $host.vars.replaced$'; $service->display_name = 'Service: $host.vars.replaced$';
$service->assignments = array( $service->assignments = array(
'host.address="127.*"', 'host.address="127.*"',
); );
$service->{'vars.custom_var'} = '$host.vars.replaced$'; $service->{'vars.custom_var'} = '$host.vars.replaced$';
$service->store($db);
$service = IcingaService::loadWithAutoIncId($service->id, $db);
$this->assertEquals( $this->assertEquals(
$this->loadRendered('service3'), $this->loadRendered('service3'),
@ -289,15 +287,12 @@ class IcingaServiceTest extends BaseTestCase
$db = $this->getDb(); $db = $this->getDb();
$service = $this->service(); $service = $this->service()->setConnection($db);
$service->object_type = 'apply'; $service->object_type = 'apply';
$service->apply_for = 'host.vars.test1'; $service->apply_for = 'host.vars.test1';
$service->assignments = array( $service->assignments = array(
'host.vars.env="test"' 'host.vars.env="test"'
); );
$service->store($db);
$service = IcingaService::loadWithAutoIncId($service->id, $db);
$this->assertEquals( $this->assertEquals(
$this->loadRendered('service5'), $this->loadRendered('service5'),
(string) $service (string) $service