예제 #1
0
 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);
 }
예제 #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);
 }