Projet

Général

Profil

Paste
Télécharger (1,08 ko) Statistiques
| Branche: | Révision:

root / drupal7 / modules / image / tests / image_module_test.module @ bfb52287

1
<?php
2

    
3
/**
4
 * @file
5
 * Provides Image module hook implementations for testing purposes.
6
 */
7

    
8
function image_module_test_file_download($uri) {
9
  if (variable_get('image_module_test_file_download', FALSE) == $uri) {
10
    return array('X-Image-Owned-By' => 'image_module_test');
11
  }
12
}
13

    
14
/**
15
 * Implements hook_image_effect_info().
16
 */
17
function image_module_test_image_effect_info() {
18
  $effects = array(
19
    'image_module_test_null' => array(
20
    'effect callback' => 'image_module_test_null_effect',
21
    ),
22
  );
23

    
24
  return $effects;
25
}
26

    
27
/**
28
 * Image effect callback; Null.
29
 *
30
 * @param $image
31
 *   An image object returned by image_load().
32
 * @param $data
33
 *   An array with no attributes.
34
 *
35
 * @return
36
 *   TRUE
37
 */
38
function image_module_test_null_effect(array &$image, array $data) {
39
  return TRUE;
40
}
41

    
42
/**
43
 * Implements hook_image_effect_info_alter().
44
 *
45
 * Used to keep a count of cache misses in image_effect_definitions().
46
 */
47
function image_module_test_image_effect_info_alter(&$effects) {
48
  $image_effects_definition_called = &drupal_static(__FUNCTION__, 0);
49
  $image_effects_definition_called++;
50
}