mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
ResultSet bugfix if tags key is missing in the result
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user