Пример #1
0
 /**
  * Returns a list of zones for a shard
  *
  * @param $shardName
  *
  * @return array
  *
  * @throws Exception\ShardNotFoundException
  */
 public function getZones($shardName)
 {
     if (!array_key_exists($shardName, $this->zones)) {
         $zoneData = $this->connector->getZones($shardName);
         $this->zones[$shardName] = ZoneHydrator::hydrate($zoneData);
     }
     return $this->zones[$shardName];
 }
Пример #2
0
 /**
  *  @expectedException \Ecn\RiftConnector\Exception\ConnectionException
  */
 public function testRetrieveZoneEventsError()
 {
     $response = $this->getMock('\\GuzzleHttp\\Message\\ResponseInterface');
     $response->method('getStatusCode')->willReturn('404');
     $client = $this->getMock('\\GuzzleHttp\\ClientInterface');
     $client->method('get')->willReturn($response);
     $connector = new Connector($client);
     $connector->getZones('2741');
 }