Mercurial > hg > rr-repo
diff modules/image/tests/image_module_test.module @ 0:ff03f76ab3fe
initial version
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Wed, 21 Aug 2013 18:51:11 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/image/tests/image_module_test.module Wed Aug 21 18:51:11 2013 +0100 @@ -0,0 +1,50 @@ +<?php + +/** + * @file + * Provides Image module hook implementations for testing purposes. + */ + +function image_module_test_file_download($uri) { + if (variable_get('image_module_test_file_download', FALSE) == $uri) { + return array('X-Image-Owned-By' => 'image_module_test'); + } +} + +/** + * Implements hook_image_effect_info(). + */ +function image_module_test_image_effect_info() { + $effects = array( + 'image_module_test_null' => array( + 'effect callback' => 'image_module_test_null_effect', + ), + ); + + return $effects; +} + +/** + * Image effect callback; Null. + * + * @param $image + * An image object returned by image_load(). + * @param $data + * An array with no attributes. + * + * @return + * TRUE + */ +function image_module_test_null_effect(array &$image, array $data) { + return TRUE; +} + +/** + * Implements hook_image_effect_info_alter(). + * + * Used to keep a count of cache misses in image_effect_definitions(). + */ +function image_module_test_image_effect_info_alter(&$effects) { + $image_effects_definition_called = &drupal_static(__FUNCTION__, 0); + $image_effects_definition_called++; +}