IcingaHostTest: ship rendered objects, compare

This commit is contained in:
Thomas Gelf 2016-02-25 21:46:51 +01:00
parent 75e2511f53
commit 9bed3b7f8a
2 changed files with 24 additions and 0 deletions

View File

@ -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()
{

View 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" ]
}
}