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__ . '/3LocalhostTest.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 $unsafeMethods = array('testHttps', 'testCatchExceptions', 'testUtf8Method');
19 foreach(get_class_methods('LocalhostTest') as $method)
21 if(strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods))
23 if (!isset(self::$failed_tests[$method]))
33 function testDeflate()
35 if(!function_exists('gzdeflate'))
37 $this->fail('Zlib missing: cannot test deflate functionality');
40 $this->client->accepted_compression = array('deflate');
41 $this->client->request_compression = 'deflate';
47 if(!function_exists('gzdeflate'))
49 $this->fail('Zlib missing: cannot test gzip functionality');
52 $this->client->accepted_compression = array('gzip');
53 $this->client->request_compression = 'gzip';
57 function testKeepAlives()
59 if(!function_exists('curl_init'))
61 $this->fail('CURL missing: cannot test http 1.1');
64 $this->method = 'http11';
65 $this->client->keepalive = true;
71 if ($this->args['PROXYSERVER'])
73 $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']);
77 $this->fail('PROXY definition missing: cannot test proxy');
82 if(!function_exists('curl_init'))
84 $this->fail('CURL missing: cannot test http 1.1');
87 $this->method = 'http11'; // not an error the double assignment!
88 $this->client->method = 'http11';
89 //$this->client->verifyhost = 0;
90 //$this->client->verifypeer = 0;
91 $this->client->keepalive = false;
95 function testHttp11Gzip()
97 if(!function_exists('curl_init'))
99 $this->fail('CURL missing: cannot test http 1.1');
102 $this->method = 'http11'; // not an error the double assignment!
103 $this->client->method = 'http11';
104 $this->client->keepalive = false;
105 $this->client->accepted_compression = array('gzip');
106 $this->client->request_compression = 'gzip';
110 function testHttp11Deflate()
112 if(!function_exists('curl_init'))
114 $this->fail('CURL missing: cannot test http 1.1');
117 $this->method = 'http11'; // not an error the double assignment!
118 $this->client->method = 'http11';
119 $this->client->keepalive = false;
120 $this->client->accepted_compression = array('deflate');
121 $this->client->request_compression = 'deflate';
125 function testHttp11Proxy()
127 if(!function_exists('curl_init'))
129 $this->fail('CURL missing: cannot test http 1.1 w. proxy');
132 else if ($this->args['PROXYSERVER'] == '')
134 $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
137 $this->method = 'http11'; // not an error the double assignment!
138 $this->client->method = 'http11';
139 $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']);
140 //$this->client->verifyhost = 0;
141 //$this->client->verifypeer = 0;
142 $this->client->keepalive = false;
148 if(!function_exists('curl_init'))
150 $this->fail('CURL missing: cannot test https functionality');
153 $this->client->server = $this->args['HTTPSSERVER'];
154 $this->method = 'https';
155 $this->client->method = 'https';
156 $this->client->path = $this->args['HTTPSURI'];
157 $this->client->setSSLVerifyPeer(!$this->args['HTTPSIGNOREPEER']);
158 $this->client->setSSLVerifyHost($this->args['HTTPSVERIFYHOST']);
159 $this->client->setSSLVersion($this->args['SSLVERSION']);
163 function testHttpsProxy()
165 if(!function_exists('curl_init'))
167 $this->fail('CURL missing: cannot test https functionality');
170 else if ($this->args['PROXYSERVER'] == '')
172 $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
175 $this->client->server = $this->args['HTTPSSERVER'];
176 $this->method = 'https';
177 $this->client->method = 'https';
178 $this->client->setProxy($this->args['PROXYSERVER'], $this->args['PROXYPORT']);
179 $this->client->path = $this->args['HTTPSURI'];
180 $this->client->setSSLVerifyPeer(!$this->args['HTTPSIGNOREPEER']);
181 $this->client->setSSLVerifyHost($this->args['HTTPSVERIFYHOST']);
182 $this->client->setSSLVersion($this->args['SSLVERSION']);
186 function testUTF8Responses()
188 //$this->client->path = strpos($URI, '?') === null ? $URI.'?RESPONSE_ENCODING=UTF-8' : $URI.'&RESPONSE_ENCODING=UTF-8';
189 $this->client->path = $this->args['URI'].'?RESPONSE_ENCODING=UTF-8';
193 function testUTF8Requests()
195 $this->client->request_charset_encoding = 'UTF-8';
199 function testISOResponses()
201 //$this->client->path = strpos($URI, '?') === null ? $URI.'?RESPONSE_ENCODING=UTF-8' : $URI.'&RESPONSE_ENCODING=UTF-8';
202 $this->client->path = $this->args['URI'].'?RESPONSE_ENCODING=ISO-8859-1';
206 function testISORequests()
208 $this->client->request_charset_encoding = 'ISO-8859-1';