3 include_once __DIR__ . '/../lib/xmlrpc.inc';
4 include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc';
6 include_once __DIR__ . '/parse_args.php';
8 include_once __DIR__ . '/LocalhostTest.php';
10 class LocalhostMultiTest extends LocalhostTest
13 * @todo reintroduce skipping of tests which failed when executed individually if test runs happen as separate processes
14 * @todo reintroduce skipping of tests within the loop
18 foreach(get_class_methods('LocalhostTest') as $method)
20 if(strpos($method, 'test') === 0 && $method != 'testHttps' && $method != 'testCatchExceptions')
22 if (!isset(self::$failed_tests[$method]))
32 function testDeflate()
34 if(!function_exists('gzdeflate'))
36 $this->fail('Zlib missing: cannot test deflate functionality');
39 $this->client->accepted_compression = array('deflate');
40 $this->client->request_compression = 'deflate';
46 if(!function_exists('gzdeflate'))
48 $this->fail('Zlib missing: cannot test gzip functionality');
51 $this->client->accepted_compression = array('gzip');
52 $this->client->request_compression = 'gzip';
56 function testKeepAlives()
58 if(!function_exists('curl_init'))
60 $this->fail('CURL missing: cannot test http 1.1');
63 $this->method = 'http11';
64 $this->client->keepalive = true;
70 if ($this->args['PROXYSERVER'])
72 $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']);
76 $this->fail('PROXY definition missing: cannot test proxy');
81 if(!function_exists('curl_init'))
83 $this->fail('CURL missing: cannot test http 1.1');
86 $this->method = 'http11'; // not an error the double assignment!
87 $this->client->method = 'http11';
88 //$this->client->verifyhost = 0;
89 //$this->client->verifypeer = 0;
90 $this->client->keepalive = false;
94 function testHttp11Gzip()
96 if(!function_exists('curl_init'))
98 $this->fail('CURL missing: cannot test http 1.1');
101 $this->method = 'http11'; // not an error the double assignment!
102 $this->client->method = 'http11';
103 $this->client->keepalive = false;
104 $this->client->accepted_compression = array('gzip');
105 $this->client->request_compression = 'gzip';
109 function testHttp11Deflate()
111 if(!function_exists('curl_init'))
113 $this->fail('CURL missing: cannot test http 1.1');
116 $this->method = 'http11'; // not an error the double assignment!
117 $this->client->method = 'http11';
118 $this->client->keepalive = false;
119 $this->client->accepted_compression = array('deflate');
120 $this->client->request_compression = 'deflate';
124 function testHttp11Proxy()
126 if(!function_exists('curl_init'))
128 $this->fail('CURL missing: cannot test http 1.1 w. proxy');
131 else if ($this->args['PROXYSERVER'] == '')
133 $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
136 $this->method = 'http11'; // not an error the double assignment!
137 $this->client->method = 'http11';
138 $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']);
139 //$this->client->verifyhost = 0;
140 //$this->client->verifypeer = 0;
141 $this->client->keepalive = false;
147 if(!function_exists('curl_init'))
149 $this->fail('CURL missing: cannot test https functionality');
152 $this->client->server = $this->args['HTTPSSERVER'];
153 $this->method = 'https';
154 $this->client->method = 'https';
155 $this->client->path = $this->args['HTTPSURI'];
156 $this->client->setSSLVerifyPeer( !$this->args['HTTPSIGNOREPEER'] );
160 function testHttpsProxy()
162 if(!function_exists('curl_init'))
164 $this->fail('CURL missing: cannot test https functionality');
167 else if ($this->args['PROXYSERVER'] == '')
169 $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
172 $this->client->server = $this->args['HTTPSSERVER'];
173 $this->method = 'https';
174 $this->client->method = 'https';
175 $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']);
176 $this->client->path = $this->args['HTTPSURI'];
177 $this->client->setSSLVerifyPeer( !$this->args['HTTPSIGNOREPEER'] );
181 function testUTF8Responses()
183 //$this->client->path = strpos($URI, '?') === null ? $URI.'?RESPONSE_ENCODING=UTF-8' : $URI.'&RESPONSE_ENCODING=UTF-8';
184 $this->client->path = $this->args['URI'].'?RESPONSE_ENCODING=UTF-8';
188 function testUTF8Requests()
190 $this->client->request_charset_encoding = 'UTF-8';
194 function testISOResponses()
196 //$this->client->path = strpos($URI, '?') === null ? $URI.'?RESPONSE_ENCODING=UTF-8' : $URI.'&RESPONSE_ENCODING=UTF-8';
197 $this->client->path = $this->args['URI'].'?RESPONSE_ENCODING=ISO-8859-1';
201 function testISORequests()
203 $this->client->request_charset_encoding = 'ISO-8859-1';