public function testRememberChampionCacheOnly() { $champions = file_get_contents('tests/Json/champion.free.json'); $this->cache->shouldReceive('has')->twice()->with('4be3fe5c15c888d40a1793190d77166b')->andReturn(true); $this->cache->shouldReceive('get')->twice()->with('4be3fe5c15c888d40a1793190d77166b')->andReturn($champions); $this->client->shouldReceive('baseUrl')->twice(); $api = new LeagueWrap\Api('key', $this->client); $api->setCacheOnly()->remember(60, $this->cache); $champion = $api->champion(); $champion->free(); $champion->free(); $this->assertEquals(0, $champion->getRequestCount()); }
public function testRememberChampionCacheOnly() { $champions = file_get_contents('tests/Json/champion.free.json'); $this->cache->shouldReceive('has')->twice()->with('39a7ac3476de98ba9d05b2d6824c5d03')->andReturn(true); $this->cache->shouldReceive('get')->twice()->with('39a7ac3476de98ba9d05b2d6824c5d03')->andReturn($champions); $this->client->shouldReceive('baseUrl')->twice(); $api = new LeagueWrap\Api('key', $this->client); $api->setCacheOnly()->remember(60, $this->cache); $champion = $api->champion(); $champion->free(); $champion->free(); $this->assertEquals(0, $champion->getRequestCount()); }