/**
  * @test
  */
 public function flushFlushesCache()
 {
     for ($i = 0; $i < 10; $i++) {
         $this->backend->set('entry_' . $i, 'foo', array('tag1'));
     }
     $this->assertTrue($this->backend->has('entry_5'));
     $this->backend->flush();
     $this->assertFalse($this->backend->has('entry_5'));
 }
 /**
  * @test Functional
  */
 public function flushByTagRemovesEntriesTaggedWithSpecifiedTag()
 {
     $this->setUpBackend();
     $identifier = 'identifier' . uniqid();
     $this->backend->set($identifier . 'A', 'data', array('tag1'));
     $this->backend->set($identifier . 'B', 'data', array('tag2'));
     $this->backend->set($identifier . 'C', 'data', array('tag1', 'tag2'));
     $this->backend->flushByTag('tag1');
     $expectedResult = array(FALSE, TRUE, FALSE);
     $actualResult = array($this->backend->has($identifier . 'A'), $this->backend->has($identifier . 'B'), $this->backend->has($identifier . 'C'));
     $this->assertSame($expectedResult, $actualResult);
 }
 /**
  * @test
  */
 public function hasInvokesRedis()
 {
     $this->redis->expects($this->once())->method('exists')->with('Foo_Cache:entry:foo')->will($this->returnValue(TRUE));
     $this->assertEquals(TRUE, $this->backend->has('foo'));
 }