diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-03-17 18:16:54 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-17 18:16:54 +0000 |
commit | 8dd24edf73fc6e9cd76138d9bd5cd5bd7d79feab (patch) | |
tree | e05396ac4330f9b32723591054c54b5c9a85bd03 /modules/gallery_unit_test/controllers/gallery_unit_test.php | |
parent | a83db20fe2dedf785bd7146c603ba5197f0e8d63 (diff) |
Fix correctness issue if there are no tables (list_tables will return null)
Clean out the module caches directly now that the module loading robustness code is gone.
Diffstat (limited to 'modules/gallery_unit_test/controllers/gallery_unit_test.php')
-rw-r--r-- | modules/gallery_unit_test/controllers/gallery_unit_test.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/gallery_unit_test/controllers/gallery_unit_test.php b/modules/gallery_unit_test/controllers/gallery_unit_test.php index 14be1cd0..92d3f117 100644 --- a/modules/gallery_unit_test/controllers/gallery_unit_test.php +++ b/modules/gallery_unit_test/controllers/gallery_unit_test.php @@ -79,8 +79,10 @@ class Gallery_Unit_Test_Controller extends Controller { Kohana::config_set('unit_test.paths', $paths); // Clean out the database - foreach ($db->list_tables() as $table) { - $db->query("DROP TABLE $table"); + if ($tables = $db->list_tables()) { + foreach ($db->list_tables() as $table) { + $db->query("DROP TABLE $table"); + } } // Clean out the filesystem @@ -88,7 +90,9 @@ class Gallery_Unit_Test_Controller extends Controller { @mkdir('test/var/logs', 0777, true); // Reset our loaded modules - module::load_modules(); + module::$module_names = array(); + module::$modules = array(); + module::$var_cache = array(); // Install all modules // Force core and user to be installed first to resolve dependencies. |