From 44551a58e9ca74d69bf755b6fc930df9de83fa33 Mon Sep 17 00:00:00 2001 From: Walter Dal Mut Date: Wed, 24 Jun 2015 07:58:41 +0200 Subject: [PATCH] Test tags are full merged --- tests/unit/Adapter/UdpAdapterTest.php | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/unit/Adapter/UdpAdapterTest.php b/tests/unit/Adapter/UdpAdapterTest.php index 3a536f3e3..d9125f1b7 100644 --- a/tests/unit/Adapter/UdpAdapterTest.php +++ b/tests/unit/Adapter/UdpAdapterTest.php @@ -208,4 +208,46 @@ EOF ] ]); } + + /** + * @group udp + */ + public function testMergeFullTagsPositions() + { + $options = (new Options()) + ->setDatabase("test") + ->setTags(["dc" => "eu-west"]); + $adapter = $this->getMockBuilder("InfluxDB\\Adapter\\UdpAdapter") + ->setConstructorArgs([$options]) + ->setMethods(["write", "generateTimeInNanoSeconds"]) + ->getMock(); + + $adapter->expects($this->any()) + ->method("generateTimeInNanoSeconds") + ->will($this->returnValue(1245)); + + $adapter->expects($this->once()) + ->method("write") + ->with(<<send([ + "tags" => [ + "region" => "eu-west-1", + ], + "points" => [ + [ + "measurement" => "mem", + "tags" => [ + "location" => "ireland", + ], + "fields" => [ + "free" => 712423, + ], + ], + ] + ]); + } }