Projet

Général

Profil

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

root / drupal7 / modules / simpletest / tests / update_script_test.install @ 1afa1695

1
<?php
2

    
3
/**
4
 * @file
5
 * Install, update and uninstall functions for the update_script_test module.
6
 */
7

    
8
/**
9
 * Implements hook_requirements().
10
 */
11
function update_script_test_requirements($phase) {
12
  $requirements = array();
13

    
14
  if ($phase == 'update') {
15
    // Set a requirements warning or error when the test requests it.
16
    $requirement_type = variable_get('update_script_test_requirement_type');
17
    switch ($requirement_type) {
18
      case REQUIREMENT_WARNING:
19
        $requirements['update_script_test'] = array(
20
          'title' => 'Update script test',
21
          'value' => 'Warning',
22
          'description' => 'This is a requirements warning provided by the update_script_test module.',
23
          'severity' => REQUIREMENT_WARNING,
24
        );
25
        break;
26
      case REQUIREMENT_ERROR:
27
        $requirements['update_script_test'] = array(
28
          'title' => 'Update script test',
29
          'value' => 'Error',
30
          'description' => 'This is a requirements error provided by the update_script_test module.',
31
          'severity' => REQUIREMENT_ERROR,
32
        );
33
        break;
34
    }
35
  }
36

    
37
  return $requirements;
38
}
39

    
40
/**
41
 * Dummy update function to run during the tests.
42
 */
43
function update_script_test_update_7000() {
44
  return t('The update_script_test_update_7000() update was executed successfully.');
45
}