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
 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());
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function delete()
 {
     $this->file->delete();
 }