fixing the TravisCI build with InfluxDB new features:

- dbs is changed to db in the latest InfluxDB when listing dbs
 - username is changed to name in the latest InfluxDB when creating
   user
 - PHPUnit_Framework_TestCase instead of phpunit_framework_testcase
 - Grouping by anything but time does not return time anymore
This commit is contained in:
Pablo Lopez Torres
2014-09-04 18:28:50 +02:00
parent cb2d802d83
commit 42d2c2d1f0
4 changed files with 8 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
use crodas\InfluxPHP\Client;
use crodas\InfluxPHP\DB;
class DBTest extends \phpunit_framework_testcase
class DBTest extends \PHPUnit_Framework_TestCase
{
public function testCreate()
{
@@ -103,17 +103,17 @@ class DBTest extends \phpunit_framework_testcase
$db = $client->test_xxx;
$client->setTimePrecision('u');
foreach ($db->query("SELECT mean(karma) FROM foobar GROUP BY type") as $row) {
foreach ($db->query("SELECT mean(karma) FROM foobar GROUP BY type, time(1h)") as $row) {
$this->assertTrue($row->time > time()*1000);
}
$client->setTimePrecision('m');
foreach ($db->query("SELECT mean(karma) FROM foobar GROUP BY type") as $row) {
foreach ($db->query("SELECT mean(karma) FROM foobar GROUP BY type, time(1h)") as $row) {
$this->assertTrue($row->time < time()*10000);
}
$client->setTimePrecision('s');
foreach ($db->query("SELECT mean(karma) FROM foobar GROUP BY type") as $row) {
foreach ($db->query("SELECT mean(karma) FROM foobar GROUP BY type, time(1h)") as $row) {
$this->assertTrue($row->time < time()+20);
}