Esempio n. 1
0
 public function testHosts()
 {
     $hosts = ['127.0.0.1' => 2181];
     $zookeeper = new Zookeeper($hosts);
     $this->assertEquals($hosts, $zookeeper->getHosts());
     $this->assertEquals('127.0.0.1:2181', $zookeeper->getHostsString());
     $zookeeper->addHost('168.192.1.14');
     $hosts['168.192.1.14'] = 2181;
     $this->assertEquals($hosts, $zookeeper->getHosts());
     $this->assertEquals('127.0.0.1:2181,168.192.1.14:2181', $zookeeper->getHostsString());
 }