diff options
Diffstat (limited to 'test/it_cache.t')
| -rwxr-xr-x | test/it_cache.t | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/it_cache.t b/test/it_cache.t index e2e94bf..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"); @@ -32,18 +32,18 @@ is(it_cache::get('it_cache_t'.rand(1, 1000)), null, "local get unknown key"); $GLOBALS['debug_aslive'] = 1; it_cache::put('it_cache_d', 42, ['distributed' => 1]); -it_cache::put('it_cache_d', 0); -unset($GLOBALS['it_cache_local']); +it_cache::put('it_cache_d', 1); +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', 1); -unset($GLOBALS['it_cache_local']); +it_cache::put('it_cache_d', 2); +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', 0); -unset($GLOBALS['it_cache_local']); +it_cache::put('it_cache_d', 3); +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"); |