From 5a162a97040c761d96e0a182013b916dded2471e Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 10 Jun 2015 13:41:06 +0200 Subject: [PATCH] Added tests for global tags and retention policies --- tests/InfluxDB/ClientFactoryTest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/InfluxDB/ClientFactoryTest.php b/tests/InfluxDB/ClientFactoryTest.php index e89d6d866..a7f0e44f1 100644 --- a/tests/InfluxDB/ClientFactoryTest.php +++ b/tests/InfluxDB/ClientFactoryTest.php @@ -79,7 +79,7 @@ class ClientFactoryTest extends \PHPUnit_Framework_TestCase * @group factory * @dataProvider getHttpAdapters */ - public function testCreateTcpClientWithFilter($adapter) + public function testCreateTcpClientWithAllOptions($adapter) { $options = [ "adapter" => [ @@ -89,6 +89,11 @@ class ClientFactoryTest extends \PHPUnit_Framework_TestCase "host" => "127.0.0.1", "username" => "user", "password" => "pass", + "retention_policy" => "too_many_data", + "tags" => [ + "region" => "eu", + "env" => "prod", + ], ], ]; @@ -99,6 +104,8 @@ class ClientFactoryTest extends \PHPUnit_Framework_TestCase $this->assertEquals("127.0.0.1", $client->getAdapter()->getOptions()->getHost()); $this->assertEquals("user", $client->getAdapter()->getOptions()->getUsername()); $this->assertEquals("pass", $client->getAdapter()->getOptions()->getPassword()); + $this->assertEquals(["region" => "eu", "env" => "prod"], $client->getAdapter()->getOptions()->getTags()); + $this->assertEquals("too_many_data", $client->getAdapter()->getOptions()->getRetentionPolicy()); } public function getHttpAdapters()