Adding Point class to handle Points

This commit is contained in:
danibrutal
2015-06-19 09:49:58 +02:00
parent 74219895ef
commit aa25eae865
4 changed files with 119 additions and 2 deletions
+21 -2
View File
@@ -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
);
}
}