deleteKey() public method

Deletes the file
public deleteKey ( string $key ) : boolean
$key string
return boolean
Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function delete()
 {
     if ($this->storage->deleteKey($this->key)) {
         $this->eventManager()->fire(StorageEvent::FILE_DELETED, new StorageEvent($this));
         return true;
     }
     return false;
 }
Exemplo n.º 2
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));
 }
Exemplo n.º 3
0
 /**
  * @dataProvider driverSet
  */
 public function testDelete(Storage $storage)
 {
     $storage->deleteKey($this->newKey);
     $this->assertFalse($storage->keyExists($this->newKey));
 }