From 703f22abcbf6c44818709d9daf3d272de98d9198 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 23 Oct 2009 09:24:09 -0700 Subject: Only look for tests that are in the active modules. Update the controller golden file to reflect the current location of files. --- .../gallery_unit_test/controllers/gallery_unit_test.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'modules/gallery_unit_test') diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php index 85747884..f72b1b08 100644 --- a/modules/gallery_unit_test/controllers/gallery_unit_test.php +++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php @@ -77,14 +77,6 @@ class Gallery_Unit_Test_Controller extends Controller { } try { - // Find all tests, excluding sample tests that come with the unit_test module. - foreach (glob(MODPATH . "*/tests") as $path) { - if ($path != MODPATH . "unit_test/tests") { - $paths[] = $path; - } - } - Kohana::config_set('unit_test.paths', $paths); - // Clean out the database if ($tables = $db->list_tables()) { foreach ($db->list_tables() as $table) { @@ -107,15 +99,18 @@ class Gallery_Unit_Test_Controller extends Controller { // Rest the cascading class path Kohana::config_set("core", Kohana::config_load("core")); - // Install all modules + // Install the active modules // Force gallery and user to be installed first to resolve dependencies. gallery_installer::install(true); module::load_modules(); module::install("user"); module::activate("user"); - $modules = array(); + $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"))) { continue; } @@ -123,6 +118,8 @@ class Gallery_Unit_Test_Controller extends Controller { module::activate($module->name); } + Kohana::config_set('unit_test.paths', $paths); + // Trigger late-binding install actions (defined in gallery_event::user_login) graphics::choose_default_toolkit(); -- cgit v1.2.3