[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaServiceTest: no need to store when setting...

git at icinga.org git at icinga.org
Tue Oct 25 04:39:56 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: 4c9de0fa34822d83ee7ec221b6785f2da9389042
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=4c9de0fa34822d83ee7ec221b6785f2da9389042

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sat Oct 22 06:37:22 2016 +0000

IcingaServiceTest: no need to store when setting...

...a connection

---

 test/php/library/Director/Objects/IcingaServiceTest.php |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/test/php/library/Director/Objects/IcingaServiceTest.php b/test/php/library/Director/Objects/IcingaServiceTest.php
index 276d671..ebc4d37 100644
--- a/test/php/library/Director/Objects/IcingaServiceTest.php
+++ b/test/php/library/Director/Objects/IcingaServiceTest.php
@@ -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



More information about the icinga-checkins mailing list