icingaweb2/test/php/library/Icinga/Protocol/Statusdat/RuntimeStateContainerTest.php

31 lines
774 B
PHP
Executable File

<?php
namespace Tests\Icinga\Protocol\Statusdat;
require_once("../../library/Icinga/Protocol/Statusdat/RuntimeStateContainer.php");
class RuntimestatecontainerTest extends \PHPUnit_Framework_TestCase
{
/**
* Test for RuntimeStateContainer::__get()
*
**/
public function testPropertyResolving()
{
$container = new \Icinga\Protocol\Statusdat\RuntimeStateContainer("
host_name=test host
current_state=0
plugin_output=test 1234 test test
test=dont read
");
$container->test = "test123";
$this->assertEquals("test host",$container->host_name);
$this->assertEquals($container->test,"test123");
$this->assertEquals(0,$container->current_state);
}
}