You are here

function imagecache_testsuite_get_tests in ImageCache Actions 8

Same name and namespace in other branches
  1. 6.2 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

It seems that the required shape in D7 is $style=>array( 'effects' => array( 0 => array('name' => 'something', 'data' => array()) ) )

4 calls to imagecache_testsuite_get_tests()
imagecache_testsuite_generate in tests/imagecache_testsuite.module
Returns the requested image derivative.
imagecache_testsuite_imagecache_default_presets in tests/imagecache_testsuite.features.inc
Implementation of hook_imagecache_default_presets().
imagecache_testsuite_image_default_styles in tests/imagecache_testsuite.module
Implements hook_image_default_styles().
imagecache_testsuite_page in tests/imagecache_testsuite.module
Returns the test suite page.

File

tests/imagecache_testsuite.module, line 332

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->uri;
    }
  }
  uasort($presets, 'element_sort');
  return $presets;
}