IcingaNotificationTest: add rendering test
This commit is contained in:
parent
c7bf68a70a
commit
ab90f51cfa
|
@ -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();
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
object Notification "___TEST___notification" {
|
||||
users = [ "___TEST___user1", "___TEST___user2" ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue