1--TEST--
2PHP Backend XML-RPC cachedClient against phpxmlrpc validator1 (easyStructTest with cache on by default 1)
3--SKIPIF--
4<?php
5if (!function_exists('curl_init')) {
6    print "Skip no CURI extension available";
7}
8--FILE--
9<?php
10set_include_path(realpath(dirname(__FILE__) . '/../../../../') . PATH_SEPARATOR . get_include_path());
11require_once('tmpdir.inc');
12require_once 'XML/RPC2/CachedClient.php';
13
14$options = array(
15	'debug' => false,
16	'backend' => 'Php',
17	'prefix' => 'validator1.',
18	'cacheOptions' => array(
19		'cacheDir' => tmpDir() . '/',
20		'lifetime' => 60,
21		'cacheByDefault' => true
22	),
23	'cacheDebug' => true
24);
25
26$client = XML_RPC2_CachedClient::create('http://phpxmlrpc.sourceforge.net/server.php', $options);
27$arg = array(
28    'moe' => 5,
29    'larry' => 6,
30    'curly' => 8
31);
32$result = $client->easyStructTest($arg);
33var_dump($result);
34$result = $client->easyStructTest($arg);
35var_dump($result);
36$result = $client->easyStructTest($arg);
37var_dump($result);
38$client->dropCacheFile___('easyStructTest', array($arg));
39
40?>
41--EXPECT--
42CACHE DEBUG : cache is not hit !
43int(19)
44CACHE DEBUG : cache is hit !
45int(19)
46CACHE DEBUG : cache is hit !
47int(19)
48