update_script_test.install 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the update_script_test module.
  5. */
  6. /**
  7. * Implements hook_requirements().
  8. */
  9. function update_script_test_requirements($phase) {
  10. $requirements = array();
  11. if ($phase == 'update') {
  12. // Set a requirements warning or error when the test requests it.
  13. $requirement_type = variable_get('update_script_test_requirement_type');
  14. switch ($requirement_type) {
  15. case REQUIREMENT_WARNING:
  16. $requirements['update_script_test'] = array(
  17. 'title' => 'Update script test',
  18. 'value' => 'Warning',
  19. 'description' => 'This is a requirements warning provided by the update_script_test module.',
  20. 'severity' => REQUIREMENT_WARNING,
  21. );
  22. break;
  23. case REQUIREMENT_ERROR:
  24. $requirements['update_script_test'] = array(
  25. 'title' => 'Update script test',
  26. 'value' => 'Error',
  27. 'description' => 'This is a requirements error provided by the update_script_test module.',
  28. 'severity' => REQUIREMENT_ERROR,
  29. );
  30. break;
  31. }
  32. }
  33. return $requirements;
  34. }
  35. /**
  36. * Dummy update function to run during the tests.
  37. */
  38. function update_script_test_update_7000() {
  39. return t('The update_script_test_update_7000() update was executed successfully.');
  40. }