summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/tests/controller_auth_data.txt10
-rw-r--r--modules/gallery_unit_test/controllers/gallery_unit_test.php17
2 files changed, 12 insertions, 15 deletions
diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt
index fdf00c5e..30102538 100644
--- a/modules/gallery/tests/controller_auth_data.txt
+++ b/modules/gallery/tests/controller_auth_data.txt
@@ -9,6 +9,11 @@ modules/gallery/controllers/albums.php _form_add
modules/gallery/controllers/combined.php javascript DIRTY_AUTH
modules/gallery/controllers/combined.php css DIRTY_AUTH
modules/gallery/controllers/file_proxy.php __call DIRTY_CSRF|DIRTY_AUTH
+modules/gallery/controllers/login.php ajax DIRTY_AUTH
+modules/gallery/controllers/login.php auth_ajax DIRTY_AUTH
+modules/gallery/controllers/login.php html DIRTY_AUTH
+modules/gallery/controllers/login.php auth_html DIRTY_AUTH
+modules/gallery/controllers/logout.php index DIRTY_CSRF|DIRTY_AUTH
modules/gallery/controllers/maintenance.php index DIRTY_AUTH
modules/gallery/controllers/rest.php __construct DIRTY_AUTH
modules/gallery/controllers/rest.php __call DIRTY_AUTH
@@ -31,10 +36,5 @@ modules/server_add/controllers/admin_server_add.php autocomplete
modules/server_add/controllers/server_add.php children DIRTY_CSRF
modules/tag/controllers/admin_tags.php index DIRTY_CSRF
modules/tag/controllers/tags.php _show DIRTY_CSRF|DIRTY_AUTH
-modules/user/controllers/login.php ajax DIRTY_AUTH
-modules/user/controllers/login.php auth_ajax DIRTY_AUTH
-modules/user/controllers/login.php html DIRTY_AUTH
-modules/user/controllers/login.php auth_html DIRTY_AUTH
-modules/user/controllers/logout.php index DIRTY_CSRF|DIRTY_AUTH
modules/user/controllers/password.php reset DIRTY_AUTH
modules/user/controllers/password.php do_reset DIRTY_CSRF|DIRTY_AUTH
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();