2015-06-19 09:49:58 +02:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Created by PhpStorm.
|
|
|
|
|
* User: dmartinez
|
|
|
|
|
* Date: 18-6-15
|
|
|
|
|
* Time: 17:39
|
|
|
|
|
*/
|
|
|
|
|
|
2015-06-23 09:19:24 +02:00
|
|
|
namespace InfluxDB\Test;
|
2015-06-19 09:49:58 +02:00
|
|
|
|
|
|
|
|
|
2015-06-23 09:19:24 +02:00
|
|
|
use InfluxDB\Point;
|
2015-06-19 09:49:58 +02:00
|
|
|
|
|
|
|
|
class PointTest extends \PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
public function testPointStringRepresentation()
|
|
|
|
|
{
|
2015-06-19 11:33:44 +02:00
|
|
|
$expected = 'cpu_load_short,host=server01,region=us-west value=0.64 myTime';
|
2015-06-19 09:49:58 +02:00
|
|
|
|
|
|
|
|
$point = new Point(
|
|
|
|
|
'cpu_load_short',
|
|
|
|
|
array('host' =>'server01', 'region'=>'us-west'),
|
|
|
|
|
array('value' => 0.64),
|
|
|
|
|
'myTime'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($expected, (string) $point);
|
|
|
|
|
}
|
|
|
|
|
}
|