public function testFlush() { $pool = new Pool(); $pool->setDriver(new DriverExceptionStub()); $item = $pool->getItem('test'); $this->assertFalse($item->isDisabled()); $this->assertFalse($pool->flush()); $item = $pool->getItem('test'); $this->assertTrue($item->isDisabled(), 'Is disabled after exception is thrown in driver'); $this->assertFalse($pool->flush()); }
function setup_cache_mocks(Pool $cache) { $cache->setDriver(Argument::any())->willReturn(true); $item = $this->prophet->prophesize('Stash\\Item'); $item->get()->willReturn('data'); $item->set(Argument::cetera())->willReturn(true); $item->isMiss()->willReturn(true); $item->lock()->willReturn(true); $item->clear()->willReturn(true); $item = $item->reveal(); $cache->getItem(Argument::any())->willReturn($item); $cache->purge()->willReturn(true); $cache->flush()->willReturn(true); return ['cache' => $cache]; }
/** * Removes all values from the cache */ public function flush() { return $this->pool->flush(); }
/** * Flush the stash cache * * @return void */ public function flushCache() { $this->pool->flush(); }
protected function doFlush() { $this->_cache->flush(); }
/** * Clean the cache of all items. * * @return bool */ public function clean() { return $this->_cache->flush(); }