Files
php-memcached/tests/getdelayed_bykey.phpt
Pavel Djundik 7348cc11f7 Move working tests up a folder (#503)
Tests in the experimental/ folder were not executed on CI. The ones that work move up, the few
that remain in experimental/ need further investigation to get working or remove.
2023-04-27 08:35:07 -07:00

68 lines
1.0 KiB
PHP

--TEST--
Memcached::getDelayedByKey()
--SKIPIF--
<?php include "skipif.inc";?>
--FILE--
<?php
include dirname(__FILE__) . '/config.inc';
$m = memc_get_instance ();
$data = array(
'foo' => 'foo-data',
'bar' => 'bar-data',
'baz' => 'baz-data',
'lol' => 'lol-data',
'kek' => 'kek-data',
);
foreach ($data as $k => $v) {
$m->setByKey('kef', $k, $v, 3600);
}
function myfunc() {
$datas = func_get_args();
if (isset($datas[1])) {
if (isset($datas[1]['cas']) and $datas[1]['cas'] == 0) {
echo "Invalid cas\n";
} else {
unset($datas[1]['cas']);
}
var_dump($datas[1]);
}
}
$m->getDelayedByKey('kef', array_keys($data), false, 'myfunc');
?>
--EXPECT--
array(2) {
["key"]=>
string(3) "foo"
["value"]=>
string(8) "foo-data"
}
array(2) {
["key"]=>
string(3) "bar"
["value"]=>
string(8) "bar-data"
}
array(2) {
["key"]=>
string(3) "baz"
["value"]=>
string(8) "baz-data"
}
array(2) {
["key"]=>
string(3) "lol"
["value"]=>
string(8) "lol-data"
}
array(2) {
["key"]=>
string(3) "kek"
["value"]=>
string(8) "kek-data"
}