From 2a21f3bc80758a20635534b837c11836a72b202c Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 28 Oct 2009 11:37:05 -0700 Subject: [PATCH] Only install and activate modules that have tests to run. --- .../controllers/gallery_unit_test.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php index f72b1b0830..58e0d9c56f 100644 --- a/modules/gallery_unit_test/controllers/gallery_unit_test.php +++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php @@ -106,16 +106,17 @@ function Index() { module::install("user"); module::activate("user"); - $modules = $paths =array(); - foreach ($active_modules as $module) { - if (file_exists($path = MODPATH . "{$module->name}/tests")) { - $paths[] = $path; - } - if (in_array($module->name, array("gallery", "user"))) { + $modules = $paths = array(); + foreach (module::available() as $module_name => $unused) { + if (in_array($module_name, array("gallery", "user"))) { + $paths[] = MODPATH . "{$module_name}/tests"; continue; } - module::install($module->name); - module::activate($module->name); + if (file_exists($path = MODPATH . "{$module_name}/tests")) { + $paths[] = $path; + module::install($module_name); + module::activate($module_name); + } } Kohana::config_set('unit_test.paths', $paths);