/** * 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]; }
/** * @expectedException \Ecn\RiftConnector\Exception\ShardNotFoundException */ public function testGetShardByNameError() { $response = $this->getMock('\\GuzzleHttp\\Message\\ResponseInterface'); $response->method('getStatusCode')->willReturn('200'); $response->method('json')->willReturn($this->getDummyShardList()); $client = $this->getMock('\\GuzzleHttp\\ClientInterface'); $client->method('get')->willReturn($response); $connector = new Connector($client); $shard = $connector->getShardByName('Foo'); }