Ejemplo n.º 1
0
 /**
  * @covers FileUtils::fileList
  */
 public function testFileListEmpty()
 {
     $content = \FileUtils::fileList(__DIR__, 'xslt');
     $this->assertEmpty($content);
 }
Ejemplo n.º 2
0
 /**
  * Remove all files with the given extension in the given directory
  *
  * @param String $directoryPath, must be full path
  * @param String $extension
  * @return int count: number of files deleted
  */
 public static function removeFilesWithExtensionInFolder($directoryPath, $extension)
 {
     $filesList = FileUtils::fileList($directoryPath, $extension);
     foreach ($filesList as $file) {
         @unlink($directoryPath . '/' . $file);
     }
     return count($filesList);
 }