/** * Disable cache. */ public static function disable() { self::$API = -1; }
function test_clearSimpleCache($cache) { $cacheAPI = new cacheAPI($cache); $tiko = new tikoCacheController($cacheAPI); // It should fetch requiredCacheParameters from cache // Since there are no required parameters, the item should now also be retrieved by cache. $tiko->removeCacheForURL(); // Now, we load a new tiko instance $cacheAPI = new cacheAPI($cache); $tiko = new tikoCacheController($cacheAPI); // It should fetch requiredCacheParameters from cache // Since there are no required parameters, the item should now also be retrieved by cache. // But, *since it is removed*, it should not be found. Let's check $result = $cacheAPI->getItem(); if ($result !== null) { fail("CLEARING OF CACHE FOR URL FAILED. CACHE IS "); var_dump($cache); } else { done("CLEARING OF CACHE FOR URL WORKED"); } }