mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 00:34:05 +02:00
IcingaHostTest: ship rendered objects, compare
This commit is contained in:
parent
75e2511f53
commit
9bed3b7f8a
@ -129,6 +129,14 @@ class IcingaHostTest extends BaseTestCase
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testWhetherAHostRendersCorrectly()
|
||||||
|
{
|
||||||
|
$this->assertEquals(
|
||||||
|
(string) $this->host(),
|
||||||
|
$this->loadRendered('host1')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function host()
|
protected function host()
|
||||||
{
|
{
|
||||||
return IcingaHost::create(array(
|
return IcingaHost::create(array(
|
||||||
@ -151,6 +159,10 @@ class IcingaHostTest extends BaseTestCase
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function loadRendered($name)
|
||||||
|
{
|
||||||
|
return file_get_contents(__DIR__ . '/rendered/' . $name . '.out');
|
||||||
|
}
|
||||||
|
|
||||||
public function tearDown()
|
public function tearDown()
|
||||||
{
|
{
|
||||||
|
12
test/php/library/Director/Objects/rendered/host1.out
Normal file
12
test/php/library/Director/Objects/rendered/host1.out
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
object Host "___TEST___host" {
|
||||||
|
display_name = "Whatever"
|
||||||
|
address = "127.0.0.127"
|
||||||
|
vars.test1 = "string"
|
||||||
|
vars.test2 = 17
|
||||||
|
vars.test3 = false
|
||||||
|
vars.test4 = {
|
||||||
|
"this" = "is"
|
||||||
|
"a" = [ "dict", "ionary" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user