Example #1
0
 /**
  * @covers LoLApi\Result\ApiResult::isFetchedFromCache
  * @covers LoLApi\Result\ApiResult::setFetchedFromCache
  */
 public function testFetchedFromCache()
 {
     $apiResult = new ApiResult();
     $this->assertFalse($apiResult->isFetchedFromCache());
     $this->assertSame($apiResult, $apiResult->setFetchedFromCache(true));
     $this->assertTrue($apiResult->isFetchedFromCache());
 }
Example #2
0
 /**
  * @param ApiResult $apiResult
  * @param int       $ttl
  */
 public function cacheApiResult(ApiResult $apiResult, $ttl = 60)
 {
     $this->cacheProvider->save($apiResult->getUrl(), json_encode($apiResult->getResult()), $ttl);
 }