From a3ac1b8eef336b68aff5ce6e358a3ad509878ab0 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sat, 26 Aug 2017 10:51:19 +0200 Subject: [PATCH] IcingaServiceSet: fix tests --- library/Director/Objects/IcingaServiceSet.php | 6 +++++- test/php/library/Director/Objects/IcingaServiceSetTest.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Director/Objects/IcingaServiceSet.php b/library/Director/Objects/IcingaServiceSet.php index c934e8e5..faafb44c 100644 --- a/library/Director/Objects/IcingaServiceSet.php +++ b/library/Director/Objects/IcingaServiceSet.php @@ -276,7 +276,11 @@ class IcingaServiceSet extends IcingaObject // checking if template object_name is unique // TODO: Move to IcingaObject if (! $this->hasBeenLoadedFromDb() && $this->isTemplate() && static::exists($name, $this->connection)) { - throw new DuplicateKeyException('%s template "%s" already existing in database!', $this->getType(), $name); + throw new DuplicateKeyException( + '%s template "%s" already existing in database!', + $this->getType(), + $name + ); } } } diff --git a/test/php/library/Director/Objects/IcingaServiceSetTest.php b/test/php/library/Director/Objects/IcingaServiceSetTest.php index c7fc05d0..d4b60de0 100644 --- a/test/php/library/Director/Objects/IcingaServiceSetTest.php +++ b/test/php/library/Director/Objects/IcingaServiceSetTest.php @@ -67,7 +67,7 @@ class IcingaServiceSetTest extends IcingaObjectTestCase $this->createObject('for_set', 'icinga_host', array( 'object_type' => 'object', 'address' => '1.2.3.4', - )); + ), false)->store(); $host = $this->loadObject('for_set', 'icinga_host'); $host->delete();