summaryrefslogtreecommitdiff
path: root/modules/update/tests/update_test.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/update/tests/update_test.module')
-rw-r--r--modules/update/tests/update_test.module26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/update/tests/update_test.module b/modules/update/tests/update_test.module
index 252edb361..34608363a 100644
--- a/modules/update/tests/update_test.module
+++ b/modules/update/tests/update_test.module
@@ -40,6 +40,32 @@ function update_test_system_info_alter(&$info, $file) {
}
/**
+ * Implements hook_update_status_alter().
+ *
+ * This checks the 'update_test_update_status' variable and sees if we need to
+ * alter the update status for the given project based on the setting. The
+ * setting is expected to be a nested associative array. If the key '#all' is
+ * defined, its subarray will include .info keys and values for all modules
+ * and themes on the system. Otherwise, the settings array is keyed by the
+ * module or theme short name and the subarrays contain settings just for that
+ * module or theme.
+ */
+function update_test_update_status_alter(&$projects) {
+ $setting = variable_get('update_test_update_status', array());
+ if (!empty($setting)) {
+ foreach ($projects as $project_name => &$project) {
+ foreach (array('#all', $project_name) as $id) {
+ if (!empty($setting[$id])) {
+ foreach ($setting[$id] as $key => $value) {
+ $project[$key] = $value;
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
* Page callback, prints mock XML for the update module.
*
* The specific XML file to print depends on two things: the project we're