From 16f8b9ec48a172b87d68b18897d1b49b69e99226 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Thu, 11 Sep 2014 19:52:17 +0200 Subject: [PATCH] Fixes import guzzle as http client description --- README.md | 4 ++-- tests/InfluxDB/ClientTest.php | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0bca6b8dd..93e50a6b4 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Use your DiC or Service Locator in order to provide a configured client use InfluxDB\Client; use InfluxDB\Options; -use InfluxDB\Adapter\GuzzleAdapter; +use InfluxDB\Adapter\GuzzleAdapter as InfluxHttpAdapter; use GuzzleHttp\Client as GuzzleHttpClient; $options = new Options(); @@ -60,7 +60,7 @@ $options->setUsername("root"); $options->setPassword("root"); $guzzleHttp = new GuzzleHttpClient(); -$adapter = new GuzzleAdapter($guzzleHttp, $options); +$adapter = new InfluxHttpAdapter($guzzleHttp, $options); $adapter->setDatabase("mine"); $influx = new Client(); diff --git a/tests/InfluxDB/ClientTest.php b/tests/InfluxDB/ClientTest.php index 34cb19ad5..3125fedf0 100644 --- a/tests/InfluxDB/ClientTest.php +++ b/tests/InfluxDB/ClientTest.php @@ -1,17 +1,15 @@ options = $options; $this->object = new Client(); - $this->hydrator = new ArraySerializable(); $client = new Crodas( $options["tcp"]["host"], @@ -39,7 +36,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase $this->anotherClient = $client; } - public function testHttpApiWorksCorrectly() + public function testGuzzleHttpApiWorksCorrectly() { $tcpOptions = $this->options["tcp"]; @@ -50,7 +47,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase $options->setPassword($tcpOptions["password"]); $guzzleHttp = new GuzzleHttpClient(); - $adapter = new GuzzleAdapter($guzzleHttp, $options); + $adapter = new InfluxHttpAdapter($guzzleHttp, $options); $adapter->setDatabase($tcpOptions["database"]); $influx = new Client(); @@ -58,7 +55,8 @@ class ClientTest extends \PHPUnit_Framework_TestCase $influx->mark("tcp.test", ["mark" => "element"]); - $cursor = $this->anotherClient->getDatabase("mine")->query("select * from tcp.test"); + $cursor = $this->anotherClient->getDatabase($tcpOptions["database"]) + ->query("select * from tcp.test"); $this->assertCount(1, $cursor); $this->assertEquals("element", $cursor[0]->mark); }