diff --git a/src/Leaseweb/InfluxDB/ResultSet.php b/src/Leaseweb/InfluxDB/ResultSet.php index dd9b91f1f..360151d9a 100644 --- a/src/Leaseweb/InfluxDB/ResultSet.php +++ b/src/Leaseweb/InfluxDB/ResultSet.php @@ -55,7 +55,7 @@ class ResultSet $points = array(); foreach ($this->getSeries() as $serie) { - if ($serie['measurement'] == $metricName || array_intersect($tags, $serie['tags'])) { + if ($serie['name'] == $metricName || array_intersect($tags, $serie['tags'])) { $points = array_merge($points, $this->getPointsFromSerie($serie)); } } diff --git a/tests/unit/ResultSetTest.php b/tests/unit/ResultSetTest.php index 82c50b526..a7a2a170d 100644 --- a/tests/unit/ResultSetTest.php +++ b/tests/unit/ResultSetTest.php @@ -24,6 +24,22 @@ class ResultSetTest extends \PHPUnit_Framework_TestCase new ResultSet($invalidJSON); } + /** + * Throws Exception if something went wrong with influxDB + * @expectedException \Leaseweb\InfluxDB\InfluxDBClientError + */ + public function testThrowsInfluxDBException() + { + + $errorResult = <<