Example #1
0
 public function testSend()
 {
     $configuration = new Configuration();
     $configuration->setHost('127.0.0.1')->setNamespace('base.name')->setPort(123456);
     $client = new Client($configuration);
     $client->addStats(array(array('namespace' => 'some.namespace', 'value' => 12, 'type' => 'ms'), array('namespace' => 'some.namespace2', 'value' => 1, 'type' => 'c')));
     $messages = $client->sendStats();
     $expected = array('base.name.some.namespace:12|ms', 'base.name.some.namespace2:1|c');
     $this->assertSame($messages, $expected);
 }
Example #2
0
 /**
  * @dataProvider providerHost
  * @param mixed $host
  */
 public function testSetHost($host)
 {
     $configuration = new Configuration();
     $configuration->setHost($host);
     $this->assertSame($host, $configuration->getHost(), 'Unexpected host.');
 }