1 file.test file_test_file_scan_callback($filepath = NULL)

Helper function for testing file_scan_directory().

Each time the function is called the file is stored in a static variable. When the function is called with no $filepath parameter, the results are returned.

Parameters

$filepath: File path

Return value

If $filepath is NULL, an array of all previous $filepath parameters:

File

core/modules/simpletest/tests/file.test, line 27
This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.

Code

function file_test_file_scan_callback($filepath = NULL) {
  $files = &backdrop_static(__FUNCTION__, array());
  if (isset($filepath)) {
    $files[] = $filepath;
  }
  else {
    return $files;
  }
}