From 1406935f2fb3ccd7608ae19e92187a936e6129b0 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Thu, 10 Sep 2015 15:59:40 +0200 Subject: Make test work on both PHP5/apcu/memcache and PHP7/memcached and name them --- tests/it_cache.t | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'tests') diff --git a/tests/it_cache.t b/tests/it_cache.t index cb11297..66fc2d3 100755 --- a/tests/it_cache.t +++ b/tests/it_cache.t @@ -2,46 +2,45 @@ 1); +it_cache::put('it_cache_d', 42, array('distributed' => 1)); unset($GLOBALS['it_cache_local']); -ok(it_cache::get('it_cache_d', 'distributed' => 1) == '1'); +is(intval(it_cache::get('it_cache_d', array('distributed' => 1))), 42, "distributed put/get number"); -it_cache::put('it_cache_d', false, 'distributed' => 1); +it_cache::put('it_cache_d', false, array('distributed' => 1)); unset($GLOBALS['it_cache_local']); -ok(it_cache::get('it_cache_d', 'distributed' => 1) === ''); +is(boolval(it_cache::get('it_cache_d', array('distributed' => 1))), false, "distributed put/get false"); -it_cache::put('it_cache_d', [2], 'distributed' => 1); +it_cache::put('it_cache_d', array(2), array('distributed' => 1)); unset($GLOBALS['it_cache_local']); -ok(it_cache::get('it_cache_d', 'distributed' => 1) === [2]); - -ok(it_cache::get('it_cache_d'.rand(1, 1000), 'distributed' => 1) === null); +is(it_cache::get('it_cache_d', array('distributed' => 1)), array(2), "distributed put/get array"); +is(it_cache::get('it_cache_d'.rand(1, 1000), array('distributed' => 1)), null, "distributed get unknown key"); -- cgit v1.2.3