public function testStatFactory()
 {
     $statConfig = $this->getStatsDConfig();
     /** @var \Tripod\StatsD $stat */
     $stat = \Tripod\TripodStatFactory::create($statConfig);
     $this->assertInstanceOf('\\Tripod\\StatsD', $stat);
     $this->assertEquals('example.com', $stat->getHost());
     $this->assertEquals(1234, $stat->getPort());
     $this->assertEquals('somePrefix', $stat->getPrefix());
     $noStat = \Tripod\TripodStatFactory::create();
     $this->assertInstanceOf('\\Tripod\\Mongo\\NoStat', $noStat);
 }
Beispiel #2
0
 /**
  * For mocking out the creation of stat objects
  * @param array $config
  * @return \Tripod\ITripodStat
  */
 protected function getStatFromStatFactory(array $config)
 {
     return \Tripod\TripodStatFactory::create($this->statsConfig);
 }