Example #1
0
 public function testDropAllCache()
 {
     $this->cache->set('key:1', 'value:1');
     $this->cache->set('key:2', 'value:2');
     $this->cache->dropAll();
     $this->assertNull($this->cache->get('key:1'));
     $this->assertNull($this->cache->get('key:2'));
 }
Example #2
0
 public function get($key)
 {
     if ($value = $this->cache->get($key)) {
         return $value;
     }
     $value = $this->storage->get($key);
     $this->cache->set($key, $value);
     return $value;
 }