From 28b41056e3ea962dce1ad017a3c0a60252195e7a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 27 May 2009 15:07:27 -0700 Subject: Restructure things so that the application is now just another module. Kohana makes this type of transition fairly straightforward in that all controllers/helpers/etc are still located in the cascading filesystem without any extra effort, except that I've temporarily added a hack to force modules/gallery into the module path. Rename what's left of "core" to be "application" so that it conforms more closely to the Kohana standard (basically, just application/config/config.php which is the minimal thing that you need in the application directory) There's still considerable work left to be done here. --- modules/gallery/tests/Var_Test.php | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 modules/gallery/tests/Var_Test.php (limited to 'modules/gallery/tests/Var_Test.php') diff --git a/modules/gallery/tests/Var_Test.php b/modules/gallery/tests/Var_Test.php new file mode 100644 index 00000000..82370631 --- /dev/null +++ b/modules/gallery/tests/Var_Test.php @@ -0,0 +1,49 @@ +assert_equal("original value", module::get_var("core", "Parameter")); + + module::set_var("core", "Parameter", "updated value"); + $this->assert_equal("updated value", module::get_var("core", "Parameter")); + } + + public function clear_parameter_test() { + module::set_var("core", "Parameter", "original value"); + $this->assert_equal("original value", module::get_var("core", "Parameter")); + + module::clear_var("core", "Parameter"); + $this->assert_equal(null, module::get_var("core", "Parameter")); + } + + public function incr_parameter_test() { + module::set_var("core", "Parameter", "original value"); + module::incr_var("core", "Parameter"); + $this->assert_equal("1", module::get_var("core", "Parameter")); + + module::set_var("core", "Parameter", "2"); + module::incr_var("core", "Parameter", "9"); + $this->assert_equal("11", module::get_var("core", "Parameter")); + + module::incr_var("core", "NonExistent", "9"); + $this->assert_equal(null, module::get_var("core", "NonExistent")); + } +} \ No newline at end of file -- cgit v1.2.3