Beispiel #1
0
 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());
 }
Beispiel #2
0
 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];
 }
Beispiel #3
0
 /**
  * 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();
 }
Beispiel #5
0
 protected function doFlush()
 {
     $this->_cache->flush();
 }
Beispiel #6
0
 /**
  * Clean the cache of all items.
  *
  * @return bool
  */
 public function clean()
 {
     return $this->_cache->flush();
 }