diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-12-04 18:44:26 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-12-04 18:44:26 -0500 |
commit | aab7344002fd390e5b62a3eb82f3a418fd294617 (patch) | |
tree | b214e7d4b3e9f0ca9818fea9e3d9efa0249c00c6 /plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Cache_APC.php | |
parent | 1fd7e5e3794621993b01a5833faa8b6fa26c3847 (diff) | |
parent | 01b089d9be046db1253cb3bb90e8635b50fddd84 (diff) |
Merge branch 'minify' into 0.9.x
Diffstat (limited to 'plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Cache_APC.php')
-rw-r--r-- | plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Cache_APC.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Cache_APC.php b/plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Cache_APC.php new file mode 100644 index 000000000..74a1b2c56 --- /dev/null +++ b/plugins/Minify/extlib/minify/min_unit_tests/test_Minify_Cache_APC.php @@ -0,0 +1,33 @@ +<?php +require_once '_inc.php'; + +require_once 'Minify/Cache/APC.php'; + +function test_Minify_Cache_APC() +{ + $prefix = 'Minify_Cache_APC : '; + if (! function_exists('apc_store')) { + return; + } + $data = str_repeat(md5('testing'), 160); + $id = 'Minify_test_cache'; + + $cache = new Minify_Cache_APC(); + + assertTrue(true === $cache->store($id, $data), $prefix . 'store'); + + assertTrue(strlen($data) === $cache->getSize($id), $prefix . 'getSize'); + + assertTrue(true === $cache->isValid($id, $_SERVER['REQUEST_TIME'] - 10), $prefix . 'isValid'); + + ob_start(); + $cache->display($id); + $displayed = ob_get_contents(); + ob_end_clean(); + + assertTrue($data === $displayed, $prefix . 'display'); + + assertTrue($data === $cache->fetch($id), $prefix . 'fetch'); +} + +test_Minify_Cache_APC();
\ No newline at end of file |