summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorUrban Müller2025-10-10 17:58:02 +0200
committerUrban Müller2025-10-10 18:21:04 +0200
commitaef9268f09a332d56d6f0a7136eb20084a6bd32a (patch)
tree286059a5d5aac9401f8c81a0b65e3fb15c3f2160 /test
parent9e39eb43ebefca7dd26a65e2a3dd6aa366ec337c (diff)
downloaditools-aef9268f09a332d56d6f0a7136eb20084a6bd32a.tar.gz
itools-aef9268f09a332d56d6f0a7136eb20084a6bd32a.tar.bz2
itools-aef9268f09a332d56d6f0a7136eb20084a6bd32a.zip
remove global variable
Diffstat (limited to 'test')
-rwxr-xr-xtest/it_cache.t14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/it_cache.t b/test/it_cache.t
index eb0df55..3e2fb0d 100755
--- a/test/it_cache.t
+++ b/test/it_cache.t
@@ -14,15 +14,15 @@ is(it_cache::get('it_cache_t'), [2], "cache put/get array");
# test non-distributed apc cache
it_cache::put('it_cache_t', 42);
-unset($GLOBALS['it_cache_local']);
+it_cache::$_local = [];
is(it_cache::get('it_cache_t'), 42, "local put/get number");
it_cache::put('it_cache_t', false);
-unset($GLOBALS['it_cache_local']);
+it_cache::$_local = [];
is(it_cache::get('it_cache_t'), false, "local put/get false");
it_cache::put('it_cache_t', [2]);
-unset($GLOBALS['it_cache_local']);
+it_cache::$_local = [];
is(it_cache::get('it_cache_t'), [2], "local put/get array");
is(it_cache::get('it_cache_t'.rand(1, 1000)), null, "local get unknown key");
@@ -31,21 +31,19 @@ is(it_cache::get('it_cache_t'.rand(1, 1000)), null, "local get unknown key");
# test distributed memcache
$GLOBALS['debug_aslive'] = 1;
-is(class_exists("Memcached", false), true);
-
it_cache::put('it_cache_d', 42, ['distributed' => 1]);
it_cache::put('it_cache_d', 1);
-unset($GLOBALS['it_cache_local']);
+it_cache::$_local = [];
is(intval(it_cache::get('it_cache_d', ['distributed' => 1])), 42, "distributed put/get number");
it_cache::put('it_cache_d', false, ['distributed' => 1]);
it_cache::put('it_cache_d', 2);
-unset($GLOBALS['it_cache_local']);
+it_cache::$_local = [];
is(boolval(it_cache::get('it_cache_d', ['distributed' => 1])), false, "distributed put/get false");
it_cache::put('it_cache_d', [2], ['distributed' => 1]);
it_cache::put('it_cache_d', 3);
-unset($GLOBALS['it_cache_local']);
+it_cache::$_local = [];
is(it_cache::get('it_cache_d', ['distributed' => 1]), [2], "distributed put/get array");
is(it_cache::get('it_cache_d'.rand(1, 1000), ['distributed' => 1]), null, "distributed get unknown key");