summaryrefslogtreecommitdiff
path: root/modules/gallery_unit_test
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
committerAndy Staudacher <andy.st@gmail.com>2009-11-15 19:44:47 -0800
commit0733dc37fda27a5ba35f9020edf3c66aa41a95a0 (patch)
tree6877946232f1b01b1c8709054c689f6658cef34f /modules/gallery_unit_test
parent218493c50be9362d4abed6900a816308fee5d978 (diff)
parent9379308f91a476f790fb8d444536719535c584e4 (diff)
Merge commit 'upstream/master'
Conflicts: modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/gallery_unit_test')
-rw-r--r--modules/gallery_unit_test/controllers/gallery_unit_test.php27
1 files changed, 13 insertions, 14 deletions
diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php
index a5dbcc1f..58e0d9c5 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) {
@@ -96,6 +88,8 @@ class Gallery_Unit_Test_Controller extends Controller {
@system("rm -rf test/var");
@mkdir('test/var/logs', 0777, true);
+ $active_modules = module::$active;
+
// Reset our caches
module::$modules = array();
module::$active = array();
@@ -105,23 +99,28 @@ 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();
- foreach (glob(MODPATH . "*/helpers/*_installer.php") as $file) {
- $module_name = basename(dirname(dirname($file)));
+ $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);
+
// Trigger late-binding install actions (defined in gallery_event::user_login)
graphics::choose_default_toolkit();