ResultSet bugfix if tags key is missing in the result

This commit is contained in:
danibrutal
2015-06-19 11:47:27 +02:00
parent 20e2527a92
commit e4f5bb94d6
5 changed files with 80 additions and 4 deletions

View File

@@ -60,6 +60,24 @@ EOD;
new ResultSet($errorResult);
}
/**
* We can get points from measurement
*/
public function testGetPointsFromNameWithoudTags()
{
$resultJsonExample = file_get_contents(dirname(__FILE__) . '/result-no-tags.example.json');
$this->resultSet = new ResultSet($resultJsonExample);
$measurementName = 'cpu_load_short';
$expectedNumberOfPoints = 2;
$points = $this->resultSet->getPoints($measurementName);
$this->assertTrue(is_array($points));
$this->assertCount($expectedNumberOfPoints, $points);
}
/**
* We can get points from measurement
*/