Redaxscript\Directory::clear PHP Method

clear() public method

clear the directory
Since: 3.0.0
public clear ( )
    public function clear()
    {
        $this->_remove($this->_directory);
    }

Usage Example

 /**
  * testClear
  *
  * @since 3.0.0
  */
 public function testClear()
 {
     /* setup */
     $directory = new Directory();
     $directory->init(Stream::url('root'));
     $directory->clear();
     /* expect and actual */
     $expectArray = ['.', '..'];
     $actualArray = scandir(Stream::url('root'));
     /* compare */
     $this->assertEquals($expectArray, $actualArray);
 }