cvs: pear /Cache_Lite/tests Cache_Lite_Function_drop.phpt
| From: | Fabien MARTY | Date: | Thu, 17 Nov 2005 09:19:55 +0000 |
| Subject: | cvs: pear /Cache_Lite/tests Cache_Lite_Function_drop.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-36343@lists.php.net to get a copy of this message | ||
fab Thu Nov 17 04:19:55 2005 EDT
Added files:
/pear/Cache_Lite/tests Cache_Lite_Function_drop.phpt
Log:
test script for the new Cache_Lite_Function drop() method
http://cvs.php.net/co.php/pear/Cache_Lite/tests/Cache_Lite_Function_drop.phpt?r=1.1&p=1
Index: pear/Cache_Lite/tests/Cache_Lite_Function_drop.phpt
+++ pear/Cache_Lite/tests/Cache_Lite_Function_drop.phpt
--TEST--
Cache_Lite::Cache_Lite_Function (drop() method)
--FILE--
<?php
require_once('callcache.inc');
require_once('tmpdir.inc');
require_once('cache_lite_function_base.inc');
$options = array(
'cacheDir' => tmpDir() . '/',
'lifeTime' => 60
);
$foo = 10;
$cache = new Cache_Lite_Function($options);
$data = $cache->call('function_to_bench', 23, 66);
echo($data."\n");
$data = $cache->call('function_to_bench', 23, 66);
echo($data."\n");
$cache->drop('function_to_bench', 23, 66);
$data = $cache->call('function_to_bench', 23, 66);
echo($data."\n");
$data = $cache->call('function_to_bench', 23, 66);
echo($data."\n");
$cache->clean();
function function_to_bench($arg1, $arg2)
{
global $foo;
$foo = $foo + 1;
echo "hello !\n";
return($foo + $arg1 + $arg2);
}
?>
--GET--
--POST--
--EXPECT--
hello !
100
hello !
100
hello !
101
hello !
101