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:
		
							parent
							
								
									cb2d802d83
								
							
						
					
					
						commit
						42d2c2d1f0
					
				@ -9,4 +9,5 @@ before_script:
 | 
			
		||||
    - curl -s http://getcomposer.org/installer | php
 | 
			
		||||
    - wget http://s3.amazonaws.com/influxdb/influxdb_latest_amd64.deb
 | 
			
		||||
    - sudo dpkg -i influxdb_latest_amd64.deb
 | 
			
		||||
    - travis_retry sudo service influxdb restart
 | 
			
		||||
    - php composer.phar install
 | 
			
		||||
 | 
			
		||||
@ -68,7 +68,7 @@ class Client extends BaseHTTP
 | 
			
		||||
        $self = $this;
 | 
			
		||||
        return array_map(function($obj) use($self) {
 | 
			
		||||
            return new DB($self, $obj['name']);
 | 
			
		||||
        }, $this->get('dbs'));
 | 
			
		||||
        }, $this->get('db'));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getDatabase($name)
 | 
			
		||||
 | 
			
		||||
@ -85,8 +85,8 @@ class DB extends BaseHTTP
 | 
			
		||||
        return new Cursor($this->get('series', ['q' => $sql, 'time_precision' => $this->timePrecision]));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function createUser($username, $password)
 | 
			
		||||
    public function createUser($name, $password)
 | 
			
		||||
    {
 | 
			
		||||
        return $this->post('users', compact('username', 'password'));
 | 
			
		||||
        return $this->post('users', compact('name', 'password'));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user