public function startCallback(CacheKey $k, callable $c, array $cparams = [], $lifetime = null) { $data = $this->start($k, $lifetime); if ($data === false) { call_user_func_array($c, $cparams); $data = $this->end(false); } return $data; }
protected function _callback(CacheAbstract $cache) { $base = 'callback'; $key1 = new CacheKey($base, 1); $cache->clean($key1); $this->assertEquals(CALLBACKVALUE, $cache->startCallback($key1, 'callbackTester')); try { $data = $cache->getData($key1); $this->assertEquals(CALLBACKVALUE, $data->stringify($cache)); } catch (Cachearium\Exceptions\NotCachedException $e) { $this->fail(); } }