public function testSetMulti()
 {
     $this->bufferedCache->setMulti(array('key' => 'value', 'key2' => 'value2'));
     // check that the values are only set on bufferedCache, not yet on real cache
     $this->assertEquals('value', $this->bufferedCache->get('key'));
     $this->assertEquals('value2', $this->bufferedCache->get('key2'));
     $this->assertEquals(false, $this->cache->get('key'));
     $this->assertEquals(false, $this->cache->get('key2'));
     $this->bufferedCache->commit();
     // check that the values are also set on real cache
     $this->assertEquals('value', $this->bufferedCache->get('key'));
     $this->assertEquals('value2', $this->bufferedCache->get('key2'));
     $this->assertEquals('value', $this->cache->get('key'));
     $this->assertEquals('value2', $this->cache->get('key2'));
 }
コード例 #2
0
 /**
  * @param array $data
  * @return bool
  */
 public function setMulti(array $data)
 {
     return $this->cache->setMulti($data, $this->exptime);
 }