/** * @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()); }
/** * @param ApiResult $apiResult * @param int $ttl */ public function cacheApiResult(ApiResult $apiResult, $ttl = 60) { $this->cacheProvider->save($apiResult->getUrl(), json_encode($apiResult->getResult()), $ttl); }