summaryrefslogtreecommitdiff
path: root/StatsdDataTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'StatsdDataTest.php')
-rw-r--r--StatsdDataTest.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/StatsdDataTest.php b/StatsdDataTest.php
new file mode 100644
index 00000000..fad9175c
--- /dev/null
+++ b/StatsdDataTest.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Liuggio\StatsdClient\Entity;
+
+use Liuggio\StatsdClient\Entity\StatsdData;
+
+
+class StatsdDataTest extends \PHPUnit_Framework_TestCase
+{
+ public function testGetMessage()
+ {
+ $statsdData = new StatsdData();
+ $statsdData->setKey('key');
+ $statsdData->setValue('value');
+ $statsdData->setMetric('c');
+
+ $this->assertEquals($statsdData->getMessage(), 'key:value|c');
+
+ $statsdData = new StatsdData();
+ $statsdData->setKey('key');
+ $statsdData->setValue(-1);
+ $statsdData->setMetric('c');
+
+ $this->assertEquals($statsdData->getMessage(), 'key:-1|c');
+
+ }
+}