public function testRollback() { $this->cache->set('key', 'value'); $this->bufferedCache->set('key', 'value-2'); $this->bufferedCache->add('key2', 'value-2'); // something else directly sets the key in the meantime... $this->cache->set('key2', 'value'); $this->bufferedCache->commit(); // both changes should have been "rolled back" and both keys should've // been cleared, in both buffered & real cache $this->assertEquals(false, $this->bufferedCache->get('key')); $this->assertEquals(false, $this->bufferedCache->get('key2')); $this->assertEquals(false, $this->cache->get('key')); $this->assertEquals(false, $this->cache->get('key2')); }
/** * @param string $key * @param null $casToken * @return mixed */ public function get($key, &$casToken = null) { return $this->cache->get($key, $casToken); }