IcingaServiceSet: fix tests

This commit is contained in:
Thomas Gelf 2017-08-26 10:51:19 +02:00
parent 18d171991e
commit a3ac1b8eef
2 changed files with 6 additions and 2 deletions

View File

@ -276,7 +276,11 @@ class IcingaServiceSet extends IcingaObject
// checking if template object_name is unique // checking if template object_name is unique
// TODO: Move to IcingaObject // TODO: Move to IcingaObject
if (! $this->hasBeenLoadedFromDb() && $this->isTemplate() && static::exists($name, $this->connection)) { 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
);
} }
} }
} }

View File

@ -67,7 +67,7 @@ class IcingaServiceSetTest extends IcingaObjectTestCase
$this->createObject('for_set', 'icinga_host', array( $this->createObject('for_set', 'icinga_host', array(
'object_type' => 'object', 'object_type' => 'object',
'address' => '1.2.3.4', 'address' => '1.2.3.4',
)); ), false)->store();
$host = $this->loadObject('for_set', 'icinga_host'); $host = $this->loadObject('for_set', 'icinga_host');
$host->delete(); $host->delete();