You are here

function imagecache_testsuite_get_tests in ImageCache Actions 6.2

Same name and namespace in other branches
  1. 8 tests/imagecache_testsuite.module \imagecache_testsuite_get_tests()
  2. 7 tests/imagecache_testsuite.module \imagecache_testsuite_get_tests()

Retrieve the list of presets, each of which contain actions and action definitions.

Scans all the module folders for files named *.imagecache_preset.inc

2 calls to imagecache_testsuite_get_tests()
imagecache_testsuite_generate in tests/imagecache_testsuite.module
Either returns the whole testsuite page or generates the requested image+preset
imagecache_testsuite_imagecache_default_presets in tests/imagecache_testsuite.features.inc
Implementation of hook_imagecache_default_presets().

File

tests/imagecache_testsuite.module, line 193

Code

function imagecache_testsuite_get_tests() {
  $presets = array();
  $folders = imagecache_testsuite_get_folders();
  foreach ($folders as $folder) {
    $preset_files = file_scan_directory($folder, ".*.imagecache_preset.inc");

    // Setting filepath in this scope allows the tests to know where they are.
    // The inc files may use it to create their rules.
    $filepath = $folder;
    foreach ($preset_files as $preset_file) {
      include_once $preset_file->filename;
    }
  }
  uasort($presets, 'element_sort');
  return $presets;
}