image_module_test.module

Provides Image module hook implementations for testing purposes.

File

drupal-7.x/modules/image/tests/image_module_test.module
View source
  1. <?php
  2. /**
  3. * @file
  4. * Provides Image module hook implementations for testing purposes.
  5. */
  6. function image_module_test_file_download($uri) {
  7. if (variable_get('image_module_test_file_download', FALSE) == $uri) {
  8. return array('X-Image-Owned-By' => 'image_module_test');
  9. }
  10. }
  11. /**
  12. * Implements hook_image_effect_info().
  13. */
  14. function image_module_test_image_effect_info() {
  15. $effects = array(
  16. 'image_module_test_null' => array(
  17. 'effect callback' => 'image_module_test_null_effect',
  18. ),
  19. );
  20. return $effects;
  21. }
  22. /**
  23. * Image effect callback; Null.
  24. *
  25. * @param $image
  26. * An image object returned by image_load().
  27. * @param $data
  28. * An array with no attributes.
  29. *
  30. * @return
  31. * TRUE
  32. */
  33. function image_module_test_null_effect(array &$image, array $data) {
  34. return TRUE;
  35. }
  36. /**
  37. * Implements hook_image_effect_info_alter().
  38. *
  39. * Used to keep a count of cache misses in image_effect_definitions().
  40. */
  41. function image_module_test_image_effect_info_alter(&$effects) {
  42. $image_effects_definition_called = &drupal_static(__FUNCTION__, 0);
  43. $image_effects_definition_called++;
  44. }