Exemplo n.º 1
0
 public function testSave()
 {
     $response = json_encode(array(array(), array()));
     $client = Mockery::mock('Memcached');
     $client->shouldReceive('set')->once()->andReturn($response);
     $cache = new Memcached($client);
     $cache->save();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function save()
 {
     $contents = $this->getForStorage();
     $expiration = $this->expire === null ? 0 : time() + $this->expire;
     $this->memcached->set($this->key, $contents, $expiration);
 }