/** * @depends testModelFindOrCreate */ public function testCache() { $this->handleDebug(__FUNCTION__); Factory::getCache()->flush(); $it = Enjoin::get('Books')->findById(1, Enjoin::WITH_CACHE); $cache = Enjoin::get('Books')->cache()->getCacheInstance()->get('9125bfc211f5ddbce7352499c9c71973'); $this->assertEquals($it, $cache); }
/** * Flush cache. */ public function flush() { if ($Cache = Factory::getCache()) { $tags = []; $this->getFlushTags($tags); if ($tags) { $Cache->tags($tags)->flush(); } } }