has() public method

Checks if a cache entry with the specified identifier exists.
public has ( string $entryIdentifier ) : boolean
$entryIdentifier string An identifier specifying the cache entry
return boolean TRUE if such an entry exists, FALSE if not
 /**
  * @test
  */
 public function expiredEntriesAreSkippedWhenIterating()
 {
     $this->backend->set('entry1', 'foo', [], 1);
     sleep(2);
     $this->assertFalse($this->backend->has('entry1'));
     $actualEntries = [];
     foreach ($this->backend as $key => $value) {
         $actualEntries[] = $key;
     }
     $this->assertEmpty($actualEntries, 'Entries should be empty');
 }
 /**
  * @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'));
 }