Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Griesbacher committed Apr 1, 2016
1 parent cd790e8 commit 0a88022
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 1 addition & 2 deletions tests/histou/basicTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public function testReturnData()
(
[type] => timepicker
[enable] => 1
[status] => Stable
[time_options] => Array
(
[0] => 5m
Expand Down Expand Up @@ -225,5 +224,5 @@ public function testReturnData()
)
)
<br>0<br>{"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":""}]}]}<br></pre>';
<br>0<br>{"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":""}]}]}<br></pre>';
}
12 changes: 12 additions & 0 deletions tests/histou/grafana/graphpanel/graphpanelinfluxbtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
}

0 comments on commit 0a88022

Please sign in to comment.