diff --git a/test/php/library/Director/Objects/IcingaHostTest.php b/test/php/library/Director/Objects/IcingaHostTest.php index eb4a546f..3a3a05e9 100644 --- a/test/php/library/Director/Objects/IcingaHostTest.php +++ b/test/php/library/Director/Objects/IcingaHostTest.php @@ -129,6 +129,14 @@ class IcingaHostTest extends BaseTestCase ); } + public function testWhetherAHostRendersCorrectly() + { + $this->assertEquals( + (string) $this->host(), + $this->loadRendered('host1') + ); + } + protected function host() { 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() { diff --git a/test/php/library/Director/Objects/rendered/host1.out b/test/php/library/Director/Objects/rendered/host1.out new file mode 100644 index 00000000..44216551 --- /dev/null +++ b/test/php/library/Director/Objects/rendered/host1.out @@ -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" ] + } +} +