keyExists() public method

Indicates whether the key exists
public keyExists ( string $key ) : boolean
$key string
return boolean
Example #1
0
 /**
  * @dataProvider driverSet
  */
 public function testStorage(Storage $storage)
 {
     $storage->setContents($this->key, 'Test contents');
     $this->assertTrue($storage->keyExists($this->key));
     $this->assertSame('Test contents', $storage->getContents($this->key));
     $storage->deleteKey($this->key);
     $this->assertFalse($storage->keyExists($this->key));
 }
Example #2
0
 /**
  * @dataProvider driverSet
  */
 public function testDelete(Storage $storage)
 {
     $storage->deleteKey($this->newKey);
     $this->assertFalse($storage->keyExists($this->newKey));
 }
Example #3
0
 /**
  * Check if file exists
  * @return bool
  */
 public function exists()
 {
     return $this->storage->keyExists($this->getKey());
 }