From 6f959deed90750d3f87f26e64fc44beb3f7ba903 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 3 Dec 2008 03:23:30 +0000 Subject: Rename generic test.php to gallery_unit_test.php to make navigation to this file a little easier --- modules/gallery_unit_test/controllers/test.php | 105 ------------------------- 1 file changed, 105 deletions(-) delete mode 100644 modules/gallery_unit_test/controllers/test.php (limited to 'modules/gallery_unit_test/controllers/test.php') diff --git a/modules/gallery_unit_test/controllers/test.php b/modules/gallery_unit_test/controllers/test.php deleted file mode 100644 index b5835556..00000000 --- a/modules/gallery_unit_test/controllers/test.php +++ /dev/null @@ -1,105 +0,0 @@ -connect(); - - // Make this the default database for the rest of this run - Database::$instances = array('default' => $db); - } catch (Exception $e) { - print "{$e->getMessage()}\n"; - return; - } - } - - // Find all tests, excluding sample tests that come with the unit_test module. - $paths = array(APPPATH . "tests"); - foreach (glob(MODPATH . "*/tests") as $path) { - if ($path != MODPATH . "unit_test/tests") { - $paths[] = $path; - } - } - Kohana::config_set('unit_test.paths', $paths); - - // We probably don't want to uninstall and reinstall the core every time, but let's start off - // this way. Uninstall modules first and core last. Ignore errors during uninstall. - try { - $this->_uninstall_modules(); - } catch (Exception $e) { - } - - $this->_install_modules(); - - print new Unit_Test(); - } - - private function _uninstall_modules() { - foreach (module::installed() as $module) { - if ($module->name == "core") { - continue; - } - - $installer_class = "{$module->name}_installer"; - Kohana::log("debug", "$installer_class"); - if (method_exists($installer_class, "uninstall")) { - call_user_func_array(array($installer_class, "uninstall"), array()); - } - } - - // Always uninstall core last. - core_installer::uninstall(); - } - - private function _install_modules() { - core_installer::install(); - - foreach (glob(MODPATH . "*/helpers/*_installer.php") as $file) { - $module_name = basename(dirname(dirname($file))); - if ($module_name == "core") { - continue; - } - - $installer_class = "{$module_name}_installer"; - if (method_exists($installer_class, "install")) { - call_user_func_array(array($installer_class, "install"), array()); - } - } - } -} -- cgit v1.2.3