예제 #1
0
    }
}
T::ok(!$res, 'none of the data exists before I write it in the cache');
if ($res) {
    T::debug($ret);
}
$res = TRUE;
$ret = array();
foreach ($data as $k => $v) {
    if (!($ret[$k] = $cache->set($k, $v, 10))) {
        $res = FALSE;
    }
}
T::ok($res, 'wrote all of my data into the cache');
if (!$res) {
    T::debug($ret);
}
$res = TRUE;
foreach ($data as $k => $v) {
    if ($cache->get($k) != $v) {
        $res = FALSE;
    }
}
T::ok($res, 'checked each key and got back what I wrote');
$ret = $cache->get(array_keys($data));
$res = TRUE;
foreach ($data as $k => $v) {
    if ($ret[$k] != $v) {
        $res = FALSE;
    }
}