Esempio n. 1
0
 /**
  * @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);
 }
Esempio n. 2
0
 /**
  * Flush cache.
  */
 public function flush()
 {
     if ($Cache = Factory::getCache()) {
         $tags = [];
         $this->getFlushTags($tags);
         if ($tags) {
             $Cache->tags($tags)->flush();
         }
     }
 }