mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Adding Point class to handle Points
This commit is contained in:
@@ -5,6 +5,7 @@ namespace Leaseweb\InfluxDB\Test;
|
||||
|
||||
use Leaseweb\InfluxDB\Client;
|
||||
use Leaseweb\InfluxDB\Database;
|
||||
use Leaseweb\InfluxDB\Point;
|
||||
|
||||
class DatabaseTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@@ -30,13 +31,31 @@ class DatabaseTest extends \PHPUnit_Framework_TestCase
|
||||
$this->db = new Database('influx_test_db', $this->mockClient);
|
||||
|
||||
$this->dataToInsert = file_get_contents(dirname(__FILE__) . '/input.example.json');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* todo:
|
||||
*/
|
||||
public function testWrite()
|
||||
{
|
||||
$point1 = new Point(
|
||||
'cpu_load_short',
|
||||
array('host' =>'server01', 'region'=>'us-west'),
|
||||
array('value' => 0.64),
|
||||
'myTime'
|
||||
);
|
||||
|
||||
$point2 = new Point(
|
||||
'cpu_load_short',
|
||||
array('host' =>'server01', 'region'=>'us-west'),
|
||||
array('value' => 0.84),
|
||||
'myTime'
|
||||
);
|
||||
|
||||
$this->db->writePoints(array($point1, $point2));
|
||||
|
||||
$this->assertTrue(
|
||||
'mockClient'
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user