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
1 changed files with 2 additions and 7 deletions

View File

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