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')); }
/** * Commits all deferred updates to real cache. * * @return bool */ public function commit() { return $this->cache->commit(); }