diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-12 08:41:48 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-12 08:41:48 +0000 |
commit | e12451cf1033e6b6cfa8e278894ccac3098ddd84 (patch) | |
tree | 4d73d5fea4dcc7d102aab4593ef2e56e8f2c3536 /modules | |
parent | 7e4d13d9bdc43ecc3b6cdd7144c40d70cda11c5a (diff) |
Refaactor module::install() and module::uninstall() out of the
scaffolding and unit test code so that we can use it consistently.
This fixes an issue where adding a module was not refreshing the
statically cached module list causing the test framework to break.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery_unit_test/controllers/gallery_unit_test.php | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php index 0275ed79..4394cebf 100644 --- a/modules/gallery_unit_test/controllers/gallery_unit_test.php +++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php @@ -50,6 +50,9 @@ class Gallery_Unit_Test_Controller extends Controller { // Make this the default database for the rest of this run Database::$instances = array('default' => $db); + + // Reset our loaded modules + module::load_modules(); } catch (Exception $e) { print "{$e->getMessage()}\n"; return; @@ -75,25 +78,14 @@ class Gallery_Unit_Test_Controller extends Controller { @system('mkdir -p test/var/logs'); // Install all modules - core_installer::install(); + module::install("core"); $modules = array(); foreach (glob(MODPATH . "*/helpers/*_installer.php") as $file) { $module_name = basename(dirname(dirname($file))); if ($module_name == "core") { continue; } - - require_once(DOCROOT . "modules/${module_name}/helpers/${module_name}_installer.php"); - - $test_dir = MODPATH . "$module_name/tests"; - if (file_exists($test_dir)) { - $modules[] = $test_dir; - } - - $installer_class = "{$module_name}_installer"; - if (method_exists($installer_class, "install")) { - call_user_func_array(array($installer_class, "install"), array()); - } + module::install($module_name); } $filter = count($_SERVER["argv"]) > 2 ? $_SERVER["argv"][2] : null; |