diff --git a/tests/histou/basicTest.php b/tests/histou/basicTest.php index 6c7d83c..eda5edc 100644 --- a/tests/histou/basicTest.php +++ b/tests/histou/basicTest.php @@ -139,7 +139,6 @@ public function testReturnData() ( [type] => timepicker [enable] => 1 - [status] => Stable [time_options] => Array ( [0] => 5m @@ -225,5 +224,5 @@ public function testReturnData() ) ) -
0
{"id":"1","title":"foo","originalTitle":"CustomDashboard","tags":[],"timezone":"browser","editable":true,"hideControls":true,"sharedCrosshair":false,"nav":[{"type":"timepicker","enable":true,"status":"Stable","time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"],"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"now":true,"collapse":false,"notice":false}],"time":{"from":"now-8h","to":"now"},"templating":{"list":[]},"annotations":{"list":[]},"refresh":"30s","version":"6","rows":[{"title":"","editable":true,"height":"400px","panels":[{"title":"","type":"text","span":12,"editable":true,"id":1,"mode":"text","content":""}]}]}
'; +
0
{"id":"1","title":"foo","originalTitle":"CustomDashboard","tags":[],"timezone":"browser","editable":true,"hideControls":true,"sharedCrosshair":false,"nav":[{"type":"timepicker","enable":true,"time_options":["5m","15m","1h","6h","12h","24h","2d","7d","30d"],"refresh_intervals":["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"],"now":true,"collapse":false,"notice":false}],"time":{"from":"now-8h","to":"now"},"templating":{"list":[]},"annotations":{"list":[]},"refresh":"30s","version":"6","rows":[{"title":"","editable":true,"height":"400px","panels":[{"title":"","type":"text","span":12,"editable":true,"id":1,"mode":"text","content":""}]}]}
'; } diff --git a/tests/histou/grafana/graphpanel/graphpanelinfluxbtest.php b/tests/histou/grafana/graphpanel/graphpanelinfluxbtest.php index 67339bd..0dda8e2 100644 --- a/tests/histou/grafana/graphpanel/graphpanelinfluxbtest.php +++ b/tests/histou/grafana/graphpanel/graphpanelinfluxbtest.php @@ -563,4 +563,16 @@ public function testCreateGraphPanelInfluxdb() $this->assertSame(2, sizeof($gpanel->toArray()['targets'])); $this->assertSame($downtime1, $gpanel->toArray()['targets'][1]); } + + public function testCreateGraphPanelInfluxdbRegex() + { + $this->init(); + $gpanel = \histou\grafana\graphpanel\GraphPanelFactory::generatePanel('gpanel'); + $target = $gpanel->genTargetSimple('host', 'service', 'command', 'perfLabel', '000', '', True); + $this->assertSame('=~', $target['tags'][0]['operator']); + $this->assertSame('/^host$/', $target['tags'][0]['value']); + $downtime = $gpanel->genDowntimeTarget('host', 'service', 'command', 'perfLabel', '', True); + $this->assertSame('=~', $downtime['tags'][0]['operator']); + $this->assertSame('/^host$/', $downtime['tags'][0]['value']); + } }