delete() public method

Deletes the file from the filesystem.
public delete ( array $metadata = [] ) : boolean
$metadata array optional metadata which should be send when write
return boolean TRUE on success
Exemplo n.º 1
0
 public function testCreateAnDeleteFile()
 {
     $fs = $this->getFilesystem();
     $filename = uniqid('test_');
     $file = new File($filename, $fs);
     $this->assertFalse($file->exists());
     $file->setContent('Hello');
     $this->assertTrue($file->exists());
     $file->delete();
     $this->assertFalse($file->exists());
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     $this->file->delete();
 }