Project

General

Profile

Paste
Download (1.9 KB) Statistics
| Branch: | Revision:

root / drupal7 / modules / simpletest / tests / update_script_test.install @ b0dc3a2e

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
      case REQUIREMENT_INFO:
35
        $requirements['update_script_test_stop'] = array(
36
          'title' => 'Update script test stop',
37
          'value' => 'Error',
38
          'description' => 'This is a requirements error provided by the update_script_test module to stop the page redirect for the info.',
39
          'severity' => REQUIREMENT_ERROR,
40
        );
41
        $requirements['update_script_test'] = array(
42
          'title' => 'Update script test',
43
          'description' => 'This is a requirements info provided by the update_script_test module.',
44
          'severity' => REQUIREMENT_INFO,
45
        );
46
        break;
47
    }
48
  }
49

    
50
  return $requirements;
51
}
52

    
53
/**
54
 * Dummy update function to run during the tests.
55
 */
56
function update_script_test_update_7000() {
57
  return t('The update_script_test_update_7000() update was executed successfully.');
58
}