Ejemplo n.º 1
0
 public function testGetBrokerDetailWithEmptyResponse()
 {
     $zookeeperMock = $this->getMockBuilder('\\ZooKeeper')->disableOriginalConstructor()->getMock();
     $zookeeperMock->expects($this->once())->method('exists')->with($this->equalTo(sprintf(Zookeeper::BROKER_DETAIL_PATH, 1)))->will($this->returnValue(true));
     $zookeeperMock->expects($this->once())->method('get')->with($this->equalTo(sprintf(Zookeeper::BROKER_DETAIL_PATH, 1)))->will($this->returnValue(null));
     $zookeeper = new Zookeeper();
     $zookeeper->setZookeeper($zookeeperMock);
     $this->assertEquals([], $zookeeper->getBrokerDetail(1));
 }