From 12d6d6662eb6300e9ea00fc39440f209b99d86d4 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 28 Jul 2009 19:06:16 +0000 Subject: - Patch #211747 by chx, alex_b, dww: allow specifying version information as part of module dependencies. --- modules/simpletest/tests/system_test.module | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules/simpletest/tests') diff --git a/modules/simpletest/tests/system_test.module b/modules/simpletest/tests/system_test.module index 07a86afdb..cab3b9e57 100644 --- a/modules/simpletest/tests/system_test.module +++ b/modules/simpletest/tests/system_test.module @@ -165,3 +165,23 @@ function system_test_exit() { watchdog('system_test', 'hook_exit'); } +/** + * Implement hook_system_info_alter(). + */ +function system_test_system_info_alter(&$info, $file) { + // We need a static otherwise the last test will fail to alter common_test. + static $test; + if (($dependencies = variable_get('dependencies', array())) || $test) { + if ($file->name == 'module_test') { + $info['hidden'] = FALSE; + $info['dependencies'][] = array_shift($dependencies); + variable_set('dependencies', $dependencies); + $test = TRUE; + } + if ($file->name == 'common_test') { + $info['hidden'] = FALSE; + $info['version'] = '7.x-2.4'; + } + } +} + -- cgit v1.2.3