IcingaNotificationTest: add rendering test

This commit is contained in:
Thomas Gelf 2016-03-16 13:54:09 +01:00
parent c7bf68a70a
commit ab90f51cfa
2 changed files with 26 additions and 0 deletions

View File

@ -112,6 +112,28 @@ class IcingaNotificationTest extends BaseTestCase
$user2->delete();
}
public function testRendersConfigurationWithRelatedUsers()
{
if ($this->skipForMissingDb()) {
return;
}
$db = $this->getDb();
$user1 = $this->user1();
$user1->store($db);
$user2 = $this->user2();
$user2->store($db);
$n = $this->notification();
$n->users = array($user1->object_name, $user2->object_name);
$this->assertEquals(
$this->loadRendered('notification1'),
(string) $n
);
}
public function testLazyUsersCanBeSet()
{
$n = $this->notification();

View File

@ -0,0 +1,4 @@
object Notification "___TEST___notification" {
users = [ "___TEST___user1", "___TEST___user2" ]
}