2 require_once '_inc.php';
4 require_once 'Minify/Cache/APC.php';
6 function test_Minify_Cache_APC()
8 $prefix = 'Minify_Cache_APC : ';
9 if (! function_exists('apc_store')) {
12 $data = str_repeat(md5('testing'), 160);
13 $id = 'Minify_test_cache';
15 $cache = new Minify_Cache_APC();
17 assertTrue(true === $cache->store($id, $data), $prefix . 'store');
19 assertTrue(strlen($data) === $cache->getSize($id), $prefix . 'getSize');
21 assertTrue(true === $cache->isValid($id, $_SERVER['REQUEST_TIME'] - 10), $prefix . 'isValid');
25 $displayed = ob_get_contents();
28 assertTrue($data === $displayed, $prefix . 'display');
30 assertTrue($data === $cache->fetch($id), $prefix . 'fetch');
33 test_Minify_Cache_APC();