3 include(dirname(__FILE__).'/parse_args.php');
5 require_once('xmlrpc.inc');
6 require_once('xmlrpcs.inc');
7 require_once('xmlrpc_wrappers.inc');
9 require_once 'phpunit.php';
10 //require_once 'PHPUnit/TestDecorator.php';
12 // let testuite run for the needed time
13 if ((int)ini_get('max_execution_time') < 180)
14 ini_set('max_execution_time', 180);
16 $suite = new PHPUnit_TestSuite();
18 // array with list of failed tests
19 $failed_tests = array();
21 class LocalhostTests extends PHPUnit_TestCase
26 var $request_compression = null;
27 var $accepted_compression = '';
29 function fail($message = '')
31 PHPUnit_TestCase::fail($message);
32 // save in global var that this particular test has failed
33 // (but only if not called from subclass objects / multitests)
34 if (function_exists('debug_backtrace') && strtolower(get_class($this)) == 'localhosttests')
37 $trace = debug_backtrace();
38 for ($i = 0; $i < count($trace); $i++)
40 if (strpos($trace[$i]['function'], 'test') === 0)
42 $failed_tests[$trace[$i]['function']] = true;
51 global $DEBUG, $LOCALSERVER, $URI;
52 $server = explode(':', $LOCALSERVER);
53 if(count($server) > 1)
55 $this->client=new xmlrpc_client($URI, $server[0], $server[1]);
59 $this->client=new xmlrpc_client($URI, $LOCALSERVER);
63 $this->client->setDebug($DEBUG);
65 $this->client->request_compression = $this->request_compression;
66 $this->client->accepted_compression = $this->accepted_compression;
69 function send($msg, $errrorcode=0, $return_response=false)
71 $r = $this->client->send($msg, $this->timeout, $this->method);
72 // for multicall, return directly array of responses
77 $this->assertEquals($r->faultCode(), $errrorcode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
93 $sendstring="here are 3 \"entities\": < > & " .
94 "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) .
95 " - isn't that great? \\\"hackery\\\" at it's best " .
96 " also don't want to miss out on \$item[0]. ".
97 "The real weird stuff follows: CRLF here".chr(13).chr(10).
98 "a simple CR here".chr(13).
99 "a simple LF here".chr(10).
100 "and then LFCR".chr(10).chr(13).
101 "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->";
102 $f=new xmlrpcmsg('examples.stringecho', array(
103 new xmlrpcval($sendstring, 'string')
108 // when sending/receiving non-US-ASCII encoded strings, XML says cr-lf can be normalized.
109 // so we relax our tests...
110 $l1 = strlen($sendstring);
111 $l2 = strlen($v->scalarval());
113 $this->assertEquals($sendstring, $v->scalarval());
115 $this->assertEquals(str_replace(array("\r\n", "\r"), array("\n", "\n"), $sendstring), $v->scalarval());
119 function testAddingDoubles()
121 // note that rounding errors mean we
122 // keep precision to sensible levels here ;-)
124 $f=new xmlrpcmsg('examples.addtwodouble',array(
125 new xmlrpcval($a, 'double'),
126 new xmlrpcval($b, 'double')
131 $this->assertEquals($a+$b,$v->scalarval());
135 function testAdding()
137 $f=new xmlrpcmsg('examples.addtwo',array(
138 new xmlrpcval(12, 'int'),
139 new xmlrpcval(-23, 'int')
144 $this->assertEquals(12-23, $v->scalarval());
148 function testInvalidNumber()
150 $f=new xmlrpcmsg('examples.addtwo',array(
151 new xmlrpcval('fred', 'int'),
152 new xmlrpcval("\"; exec('ls')", 'int')
155 /// @todo a fault condition should be generated here
156 /// by the server, which we pick up on
159 $this->assertEquals(0, $v->scalarval());
163 function testBoolean()
165 $f=new xmlrpcmsg('examples.invertBooleans', array(
167 new xmlrpcval(true, 'boolean'),
168 new xmlrpcval(false, 'boolean'),
169 new xmlrpcval(1, 'boolean'),
170 new xmlrpcval(0, 'boolean'),
171 //new xmlrpcval('true', 'boolean'),
172 //new xmlrpcval('false', 'boolean')
182 for($i=0; $i<$sz; $i++)
194 $this->assertEquals($answer, $got);
198 function testBase64()
200 $sendstring='Mary had a little lamb,
201 Whose fleece was white as snow,
202 And everywhere that Mary went
203 the lamb was sure to go.
205 Mary had a little lamb
206 She tied it to a pylon
207 Ten thousand volts went down its back
208 And turned it into nylon';
209 $f=new xmlrpcmsg('examples.decode64',array(
210 new xmlrpcval($sendstring, 'base64')
215 if (strlen($sendstring) == strlen($v->scalarval()))
216 $this->assertEquals($sendstring, $v->scalarval());
218 $this->assertEquals(str_replace(array("\r\n", "\r"), array("\n", "\n"), $sendstring), $v->scalarval());
222 function testDateTime()
225 $t1 = new xmlrpcval($time, 'dateTime.iso8601');
226 $t2 = new xmlrpcval(iso8601_encode($time), 'dateTime.iso8601');
227 $this->assertEquals($t1->serialize(), $t2->serialize());
228 if (class_exists('DateTime'))
230 $datetime = new DateTime();
231 $t3 = new xmlrpcval($datetime->setTimestamp($time), 'dateTime.iso8601');
232 $this->assertEquals($t1->serialize(), $t3->serialize());
236 function testCountEntities()
238 $sendstring = "h'fd>onc>>l>>rw&bpu>q>e<v&gxs<ytjzkami<";
239 $f = new xmlrpcmsg('validator1.countTheEntities',array(
240 new xmlrpcval($sendstring, 'string')
242 $v = $this->send($f);
247 $expect_array = array('ctLeftAngleBrackets','ctRightAngleBrackets','ctAmpersands','ctApostrophes','ctQuotes');
248 while(list(,$val) = each($expect_array))
250 $b = $v->structmem($val);
251 $got .= $b->me['int'];
253 $this->assertEquals($expected, $got);
257 function _multicall_msg($method, $params)
259 $struct['methodName'] = new xmlrpcval($method, 'string');
260 $struct['params'] = new xmlrpcval($params, 'array');
261 return new xmlrpcval($struct, 'struct');
264 function testServerMulticall()
266 // We manually construct a system.multicall() call to ensure
267 // that the server supports it.
269 // NB: This test will NOT pass if server does not support system.multicall.
271 // Based on http://xmlrpc-c.sourceforge.net/hacks/test_multicall.py
272 $good1 = $this->_multicall_msg(
274 array(php_xmlrpc_encode('system.listMethods')));
275 $bad = $this->_multicall_msg(
277 array(php_xmlrpc_encode(1), php_xmlrpc_encode(2)));
278 $recursive = $this->_multicall_msg(
280 array(new xmlrpcval(array(), 'array')));
281 $good2 = $this->_multicall_msg(
282 'system.methodSignature',
283 array(php_xmlrpc_encode('system.listMethods')));
284 $arg = new xmlrpcval(
285 array($good1, $bad, $recursive, $good2),
289 $f = new xmlrpcmsg('system.multicall', array($arg));
290 $v = $this->send($f);
293 //$this->assertTrue($r->faultCode() == 0, "fault from system.multicall");
294 $this->assertTrue($v->arraysize() == 4, "bad number of return values");
296 $r1 = $v->arraymem(0);
298 $r1->kindOf() == 'array' && $r1->arraysize() == 1,
299 "did not get array of size 1 from good1"
302 $r2 = $v->arraymem(1);
304 $r2->kindOf() == 'struct',
308 $r3 = $v->arraymem(2);
310 $r3->kindOf() == 'struct',
311 "recursive system.multicall did not fail"
314 $r4 = $v->arraymem(3);
316 $r4->kindOf() == 'array' && $r4->arraysize() == 1,
317 "did not get array of size 1 from good2"
322 function testClientMulticall1()
324 // NB: This test will NOT pass if server does not support system.multicall.
326 $this->client->no_multicall = false;
328 $good1 = new xmlrpcmsg('system.methodHelp',
329 array(php_xmlrpc_encode('system.listMethods')));
330 $bad = new xmlrpcmsg('test.nosuch',
331 array(php_xmlrpc_encode(1), php_xmlrpc_encode(2)));
332 $recursive = new xmlrpcmsg('system.multicall',
333 array(new xmlrpcval(array(), 'array')));
334 $good2 = new xmlrpcmsg('system.methodSignature',
335 array(php_xmlrpc_encode('system.listMethods'))
338 $r = $this->send(array($good1, $bad, $recursive, $good2));
341 $this->assertTrue(count($r) == 4, "wrong number of return values");
344 $this->assertTrue($r[0]->faultCode() == 0, "fault from good1");
345 if(!$r[0]->faultCode())
347 $val = $r[0]->value();
349 $val->kindOf() == 'scalar' && $val->scalartyp() == 'string',
350 "good1 did not return string"
353 $this->assertTrue($r[1]->faultCode() != 0, "no fault from bad");
354 $this->assertTrue($r[2]->faultCode() != 0, "no fault from recursive system.multicall");
355 $this->assertTrue($r[3]->faultCode() == 0, "fault from good2");
356 if(!$r[3]->faultCode())
358 $val = $r[3]->value();
359 $this->assertTrue($val->kindOf() == 'array', "good2 did not return array");
361 // This is the only assert in this test which should fail
362 // if the test server does not support system.multicall.
363 $this->assertTrue($this->client->no_multicall == false,
364 "server does not support system.multicall"
368 function testClientMulticall2()
370 // NB: This test will NOT pass if server does not support system.multicall.
372 $this->client->no_multicall = true;
374 $good1 = new xmlrpcmsg('system.methodHelp',
375 array(php_xmlrpc_encode('system.listMethods')));
376 $bad = new xmlrpcmsg('test.nosuch',
377 array(php_xmlrpc_encode(1), php_xmlrpc_encode(2)));
378 $recursive = new xmlrpcmsg('system.multicall',
379 array(new xmlrpcval(array(), 'array')));
380 $good2 = new xmlrpcmsg('system.methodSignature',
381 array(php_xmlrpc_encode('system.listMethods'))
384 $r = $this->send(array($good1, $bad, $recursive, $good2));
387 $this->assertTrue(count($r) == 4, "wrong number of return values");
390 $this->assertTrue($r[0]->faultCode() == 0, "fault from good1");
391 if(!$r[0]->faultCode())
393 $val = $r[0]->value();
395 $val->kindOf() == 'scalar' && $val->scalartyp() == 'string',
396 "good1 did not return string");
398 $this->assertTrue($r[1]->faultCode() != 0, "no fault from bad");
399 $this->assertTrue($r[2]->faultCode() == 0, "fault from (non recursive) system.multicall");
400 $this->assertTrue($r[3]->faultCode() == 0, "fault from good2");
401 if(!$r[3]->faultCode())
403 $val = $r[3]->value();
404 $this->assertTrue($val->kindOf() == 'array', "good2 did not return array");
408 function testClientMulticall3()
410 // NB: This test will NOT pass if server does not support system.multicall.
412 $this->client->return_type = 'phpvals';
413 $this->client->no_multicall = false;
415 $good1 = new xmlrpcmsg('system.methodHelp',
416 array(php_xmlrpc_encode('system.listMethods')));
417 $bad = new xmlrpcmsg('test.nosuch',
418 array(php_xmlrpc_encode(1), php_xmlrpc_encode(2)));
419 $recursive = new xmlrpcmsg('system.multicall',
420 array(new xmlrpcval(array(), 'array')));
421 $good2 = new xmlrpcmsg('system.methodSignature',
422 array(php_xmlrpc_encode('system.listMethods'))
425 $r = $this->send(array($good1, $bad, $recursive, $good2));
428 $this->assertTrue(count($r) == 4, "wrong number of return values");
430 $this->assertTrue($r[0]->faultCode() == 0, "fault from good1");
431 if(!$r[0]->faultCode())
433 $val = $r[0]->value();
435 is_string($val) , "good1 did not return string");
437 $this->assertTrue($r[1]->faultCode() != 0, "no fault from bad");
438 $this->assertTrue($r[2]->faultCode() != 0, "no fault from recursive system.multicall");
439 $this->assertTrue($r[3]->faultCode() == 0, "fault from good2");
440 if(!$r[3]->faultCode())
442 $val = $r[3]->value();
443 $this->assertTrue(is_array($val), "good2 did not return array");
445 $this->client->return_type = 'xmlrpcvals';
448 function testCatchWarnings()
450 $f = new xmlrpcmsg('examples.generatePHPWarning', array(
451 new xmlrpcval('whatever', 'string')
453 $v = $this->send($f);
456 $this->assertEquals($v->scalarval(), true);
460 function testCatchExceptions()
463 $f = new xmlrpcmsg('examples.raiseException', array(
464 new xmlrpcval('whatever', 'string')
466 $v = $this->send($f, $GLOBALS['xmlrpcerr']['server_error']);
467 $this->client->path = $URI.'?EXCEPTION_HANDLING=1';
468 $v = $this->send($f, 1);
469 $this->client->path = $URI.'?EXCEPTION_HANDLING=2';
470 $v = $this->send($f, $GLOBALS['xmlrpcerr']['invalid_return']);
473 function testZeroParams()
475 $f = new xmlrpcmsg('system.listMethods');
476 $v = $this->send($f);
479 function testCodeInjectionServerSide()
481 $f = new xmlrpcmsg('system.MethodHelp');
482 $f->payload = "<?xml version=\"1.0\"?><methodCall><methodName>validator1.echoStructTest</methodName><params><param><value><struct><member><name>','')); echo('gotcha!'); die(); //</name></member></struct></value></param></params></methodCall>";
483 $v = $this->send($f);
484 //$v = $r->faultCode();
487 $this->assertEquals(0, $v->structsize());
491 function testAutoRegisteredFunction()
493 $f=new xmlrpcmsg('examples.php.getStateName',array(
494 new xmlrpcval(23, 'int')
499 $this->assertEquals('Michigan', $v->scalarval());
503 $this->fail('Note: server can only auto register functions if running with PHP 5.0.3 and up');
507 function testAutoRegisteredClass()
509 $f=new xmlrpcmsg('examples.php2.getStateName',array(
510 new xmlrpcval(23, 'int')
515 $this->assertEquals('Michigan', $v->scalarval());
516 $f=new xmlrpcmsg('examples.php3.getStateName',array(
517 new xmlrpcval(23, 'int')
522 $this->assertEquals('Michigan', $v->scalarval());
527 $this->fail('Note: server can only auto register class methods if running with PHP 5.0.3 and up');
531 function testAutoRegisteredMethod()
533 $func=wrap_xmlrpc_method($this->client, 'examples.getStateName');
536 $this->fail('Registration of examples.getStateName failed');
541 $this->assertEquals('Michigan', $v);
545 function testGetCookies()
547 // let server set to us some cookies we tell it
550 'c2' => array('value' => 'c2'),
551 'c3' => array('value' => 'c3', 'expires' => time()+60*60*24*30),
552 'c4' => array('value' => 'c4', 'expires' => time()+60*60*24*30, 'path' => '/'),
553 'c5' => array('value' => 'c5', 'expires' => time()+60*60*24*30, 'path' => '/', 'domain' => 'localhost'),
555 $cookiesval = php_xmlrpc_encode($cookies);
556 $f=new xmlrpcmsg('examples.setcookies',array($cookiesval));
557 $r=$this->send($f, 0, true);
561 $this->assertEquals(1, $v->scalarval());
562 // now check if we decoded the cookies as we had set them
563 $rcookies = $r->cookies();
564 // remove extra cookies which might have been set by proxies
565 foreach($rcookies as $c => $v)
566 if(!in_array($c, array('c2', 'c3', 'c4', 'c5')))
567 unset($rcookies[$c]);
568 foreach($cookies as $c => $v)
569 // format for date string in cookies: 'Mon, 31 Oct 2005 13:50:56 GMT'
570 // but PHP versions differ on that, some use 'Mon, 31-Oct-2005 13:50:56 GMT'...
571 if(isset($v['expires']))
573 if (isset($rcookies[$c]['expires']) && strpos($rcookies[$c]['expires'], '-'))
575 $cookies[$c]['expires'] = gmdate('D, d\-M\-Y H:i:s \G\M\T' ,$cookies[$c]['expires']);
579 $cookies[$c]['expires'] = gmdate('D, d M Y H:i:s \G\M\T' ,$cookies[$c]['expires']);
582 $this->assertEquals($cookies, $rcookies);
586 function testSetCookies()
588 // let server set to us some cookies we tell it
593 'c3' => '!@#$%^&*()_+|}{":?><,./\';[]\\=-'
595 $f=new xmlrpcmsg('examples.getcookies',array());
596 foreach ($cookies as $cookie => $val)
598 $this->client->setCookie($cookie, $val);
599 $cookies[$cookie] = (string) $cookies[$cookie];
601 $r = $this->client->send($f, $this->timeout, $this->method);
602 $this->assertEquals($r->faultCode(), 0, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
606 $v = php_xmlrpc_decode($v);
607 // on IIS and Apache getallheaders returns something slightly different...
608 $this->assertEquals($v, $cookies);
612 function testSendTwiceSameMsg()
614 $f=new xmlrpcmsg('examples.stringecho', array(
615 new xmlrpcval('hello world', 'string')
617 $v1 = $this->send($f);
618 $v2 = $this->send($f);
619 //$v = $r->faultCode();
622 $this->assertEquals($v2, $v1);
627 class LocalHostMultiTests extends LocalhostTests
631 global $failed_tests;
632 foreach(get_class_methods('LocalhostTests') as $meth)
634 if(strpos($meth, 'test') === 0 && $meth != 'testHttps' && $meth != 'testCatchExceptions')
636 if (!isset($failed_tests[$meth]))
646 function testDeflate()
648 if(!function_exists('gzdeflate'))
650 $this->fail('Zlib missing: cannot test deflate functionality');
653 $this->client->accepted_compression = array('deflate');
654 $this->client->request_compression = 'deflate';
660 if(!function_exists('gzdeflate'))
662 $this->fail('Zlib missing: cannot test gzip functionality');
665 $this->client->accepted_compression = array('gzip');
666 $this->client->request_compression = 'gzip';
670 function testKeepAlives()
672 if(!function_exists('curl_init'))
674 $this->fail('CURL missing: cannot test http 1.1');
677 $this->method = 'http11';
678 $this->client->keepalive = true;
684 global $PROXYSERVER, $PROXYPORT, $NOPROXY;
687 $this->client->setProxy($PROXYSERVER, $PROXYPORT);
692 $this->fail('PROXY definition missing: cannot test proxy');
695 function testHttp11()
697 if(!function_exists('curl_init'))
699 $this->fail('CURL missing: cannot test http 1.1');
702 $this->method = 'http11'; // not an error the double assignment!
703 $this->client->method = 'http11';
704 //$this->client->verifyhost = 0;
705 //$this->client->verifypeer = 0;
706 $this->client->keepalive = false;
710 function testHttp11Gzip()
712 if(!function_exists('curl_init'))
714 $this->fail('CURL missing: cannot test http 1.1');
717 $this->method = 'http11'; // not an error the double assignment!
718 $this->client->method = 'http11';
719 $this->client->keepalive = false;
720 $this->client->accepted_compression = array('gzip');
721 $this->client->request_compression = 'gzip';
725 function testHttp11Deflate()
727 if(!function_exists('curl_init'))
729 $this->fail('CURL missing: cannot test http 1.1');
732 $this->method = 'http11'; // not an error the double assignment!
733 $this->client->method = 'http11';
734 $this->client->keepalive = false;
735 $this->client->accepted_compression = array('deflate');
736 $this->client->request_compression = 'deflate';
740 function testHttp11Proxy()
742 global $PROXYSERVER, $PROXYPORT, $NOPROXY;
743 if(!function_exists('curl_init'))
745 $this->fail('CURL missing: cannot test http 1.1 w. proxy');
748 else if ($PROXYSERVER == '')
751 $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
754 $this->method = 'http11'; // not an error the double assignment!
755 $this->client->method = 'http11';
756 $this->client->setProxy($PROXYSERVER, $PROXYPORT);
757 //$this->client->verifyhost = 0;
758 //$this->client->verifypeer = 0;
759 $this->client->keepalive = false;
765 global $HTTPSSERVER, $HTTPSURI, $HTTPSIGNOREPEER;
766 if(!function_exists('curl_init'))
768 $this->fail('CURL missing: cannot test https functionality');
771 $this->client->server = $HTTPSSERVER;
772 $this->method = 'https';
773 $this->client->method = 'https';
774 $this->client->path = $HTTPSURI;
775 $this->client->setSSLVerifyPeer( !$HTTPSIGNOREPEER );
779 function testHttpsProxy()
781 global $HTTPSSERVER, $HTTPSURI, $PROXYSERVER, $PROXYPORT, $NOPROXY;
782 if(!function_exists('curl_init'))
784 $this->fail('CURL missing: cannot test https functionality');
787 else if ($PROXYSERVER == '')
790 $this->fail('PROXY definition missing: cannot test proxy w. http 1.1');
793 $this->client->server = $HTTPSSERVER;
794 $this->method = 'https';
795 $this->client->method = 'https';
796 $this->client->setProxy($PROXYSERVER, $PROXYPORT);
797 $this->client->path = $HTTPSURI;
801 function testUTF8Responses()
804 //$this->client->path = strpos($URI, '?') === null ? $URI.'?RESPONSE_ENCODING=UTF-8' : $URI.'&RESPONSE_ENCODING=UTF-8';
805 $this->client->path = $URI.'?RESPONSE_ENCODING=UTF-8';
809 function testUTF8Requests()
811 $this->client->request_charset_encoding = 'UTF-8';
815 function testISOResponses()
818 //$this->client->path = strpos($URI, '?') === null ? $URI.'?RESPONSE_ENCODING=UTF-8' : $URI.'&RESPONSE_ENCODING=UTF-8';
819 $this->client->path = $URI.'?RESPONSE_ENCODING=ISO-8859-1';
823 function testISORequests()
825 $this->client->request_charset_encoding = 'ISO-8859-1';
830 class ParsingBugsTests extends PHPUnit_TestCase
832 function testMinusOneString()
834 $v=new xmlrpcval('-1');
835 $u=new xmlrpcval('-1', 'string');
836 $this->assertEquals($u->scalarval(), $v->scalarval());
839 function testUnicodeInMemberName(){
840 $str = "G".chr(252)."nter, El".chr(232)."ne";
841 $v = array($str => new xmlrpcval(1));
842 $r = new xmlrpcresp(new xmlrpcval($v, 'struct'));
843 $r = $r->serialize();
844 $m = new xmlrpcmsg('dummy');
845 $r = $m->parseResponse($r);
847 $this->assertEquals($v->structmemexists($str), true);
850 function testUnicodeInErrorString()
852 $response = utf8_encode(
853 '<?xml version="1.0"?>
855 <!-- found by G. giunta, covers what happens when lib receives
856 UTF8 chars in response text and comments -->
857 <!-- ���àüè -->
863 <name>faultCode</name>
864 <value><int>888</int></value>
867 <name>faultString</name>
868 <value><string>���àüè</string></value>
874 $m=new xmlrpcmsg('dummy');
875 $r=$m->parseResponse($response);
876 $v=$r->faultString();
877 $this->assertEquals('���à üè', $v);
880 function testValidNumbers()
882 $m=new xmlrpcmsg('dummy');
884 '<?xml version="1.0"?>
891 <name>integer1</name>
892 <value><int>01</int></value>
896 <value><double>01.10</double></value>
899 <name>integer2</name>
900 <value><int>+1</int></value>
904 <value><double>+1.10</double></value>
908 <value><double>-1.10e2</double></value>
915 $r=$m->parseResponse($fp);
917 $s=$v->structmem('integer1');
918 $t=$v->structmem('float1');
919 $u=$v->structmem('integer2');
920 $w=$v->structmem('float2');
921 $x=$v->structmem('float3');
922 $this->assertEquals(1, $s->scalarval());
923 $this->assertEquals(1.1, $t->scalarval());
924 $this->assertEquals(1, $u->scalarval());
925 $this->assertEquals(1.1, $w->scalarval());
926 $this->assertEquals(-110.0, $x->scalarval());
929 function testAddScalarToStruct()
931 $v=new xmlrpcval(array('a' => 'b'), 'struct');
932 // use @ operator in case error_log gets on screen
933 $r= @$v->addscalar('c');
934 $this->assertEquals(0, $r);
937 function testAddStructToStruct()
939 $v=new xmlrpcval(array('a' => new xmlrpcval('b')), 'struct');
940 $r=$v->addstruct(array('b' => new xmlrpcval('c')));
941 $this->assertEquals(2, $v->structsize());
942 $this->assertEquals(1, $r);
943 $r=$v->addstruct(array('b' => new xmlrpcval('b')));
944 $this->assertEquals(2, $v->structsize());
947 function testAddArrayToArray()
949 $v=new xmlrpcval(array(new xmlrpcval('a'), new xmlrpcval('b')), 'array');
950 $r=$v->addarray(array(new xmlrpcval('b'), new xmlrpcval('c')));
951 $this->assertEquals(4, $v->arraysize());
952 $this->assertEquals(1, $r);
955 function testEncodeArray()
958 $v = php_xmlrpc_encode($r);
959 $this->assertEquals('array', $v->kindof());
962 function testEncodeRecursive()
964 $v = php_xmlrpc_encode(php_xmlrpc_encode('a simple string'));
965 $this->assertEquals('scalar', $v->kindof());
968 function testBrokenRequests()
970 $s = new xmlrpc_server();
971 // omitting the 'params' tag: not tolerated by the lib anymore
972 $f = '<?xml version="1.0"?>
974 <methodName>system.methodHelp</methodName>
976 <value><string>system.methodHelp</string></value>
979 $r = $s->parserequest($f);
980 $this->assertEquals(15, $r->faultCode());
981 // omitting a 'param' tag
982 $f = '<?xml version="1.0"?>
984 <methodName>system.methodHelp</methodName>
986 <value><string>system.methodHelp</string></value>
989 $r = $s->parserequest($f);
990 $this->assertEquals(15, $r->faultCode());
991 // omitting a 'value' tag
992 $f = '<?xml version="1.0"?>
994 <methodName>system.methodHelp</methodName>
996 <param><string>system.methodHelp</string></param>
999 $r = $s->parserequest($f);
1000 $this->assertEquals(15, $r->faultCode());
1003 function testBrokenResponses()
1005 $m=new xmlrpcmsg('dummy');
1007 // omitting the 'params' tag: no more tolerated by the lib...
1008 $f = '<?xml version="1.0"?>
1011 <value><string>system.methodHelp</string></value>
1014 $r = $m->parseResponse($f);
1015 $this->assertEquals(2, $r->faultCode());
1016 // omitting the 'param' tag: no more tolerated by the lib...
1017 $f = '<?xml version="1.0"?>
1020 <value><string>system.methodHelp</string></value>
1023 $r = $m->parseResponse($f);
1024 $this->assertEquals(2, $r->faultCode());
1025 // omitting a 'value' tag: KO
1026 $f = '<?xml version="1.0"?>
1029 <param><string>system.methodHelp</string></param>
1032 $r = $m->parseResponse($f);
1033 $this->assertEquals(2, $r->faultCode());
1036 function testBuggyHttp()
1038 $s = new xmlrpcmsg('dummy');
1039 $f = 'HTTP/1.1 100 Welcome to the jungle
1042 X-Content-Marx-Brothers: Harpo
1044 Content-Length: who knows?
1048 <?xml version="1.0"?>
1049 <!-- First of all, let\'s check out if the lib properly handles a commented </methodResponse> tag... -->
1050 <methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
1051 <member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>hello world. 2 newlines follow
1054 and there they were.</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
1055 <script type="text\javascript">document.write(\'Hello, my name is added nag, I\\\'m happy to serve your content for free\');</script>
1057 $r = $s->parseResponse($f);
1059 $s = $v->structmem('content');
1060 $this->assertEquals("hello world. 2 newlines follow\n\n\nand there they were.", $s->scalarval());
1063 function testStringBug()
1065 $s = new xmlrpcmsg('dummy');
1066 $f = '<?xml version="1.0"?>
1068 <!-- found by 2z69xks7bpy001@sneakemail.com, amongst others
1069 covers what happens when there\'s character data after </string>
1070 and before </value> -->
1077 <name>success</name>
1079 <boolean>1</boolean>
1083 <name>sessionID</name>
1085 <string>S300510007I</string>
1092 </methodResponse> ';
1093 $r = $s->parseResponse($f);
1095 $s = $v->structmem('sessionID');
1096 $this->assertEquals('S300510007I', $s->scalarval());
1099 function testWhiteSpace()
1101 $s = new xmlrpcmsg('dummy');
1102 $f = '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
1103 <member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>hello world. 2 newlines follow
1106 and there they were.</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
1108 $r = $s->parseResponse($f);
1110 $s = $v->structmem('content');
1111 $this->assertEquals("hello world. 2 newlines follow\n\n\nand there they were.", $s->scalarval());
1114 function testDoubleDataInArrayTag()
1116 $s = new xmlrpcmsg('dummy');
1117 $f = '<?xml version="1.0"?><methodResponse><params><param><value><array>
1120 </array></value></param></params></methodResponse>
1122 $r = $s->parseResponse($f);
1123 $v = $r->faultCode();
1124 $this->assertEquals(2, $v);
1125 $f = '<?xml version="1.0"?><methodResponse><params><param><value><array>
1126 <data><value>Hello world</value></data>
1128 </array></value></param></params></methodResponse>
1130 $r = $s->parseResponse($f);
1131 $v = $r->faultCode();
1132 $this->assertEquals(2, $v);
1135 function testDoubleStuffInValueTag()
1137 $s = new xmlrpcmsg('dummy');
1138 $f = '<?xml version="1.0"?><methodResponse><params><param><value>
1139 <string>hello world</string>
1140 <array><data></data></array>
1141 </value></param></params></methodResponse>
1143 $r = $s->parseResponse($f);
1144 $v = $r->faultCode();
1145 $this->assertEquals(2, $v);
1146 $f = '<?xml version="1.0"?><methodResponse><params><param><value>
1147 <string>hello</string>
1148 <string>world</string>
1149 </value></param></params></methodResponse>
1151 $r = $s->parseResponse($f);
1152 $v = $r->faultCode();
1153 $this->assertEquals(2, $v);
1154 $f = '<?xml version="1.0"?><methodResponse><params><param><value>
1155 <string>hello</string>
1156 <struct><member><name>hello><value>world</value></member></struct>
1157 </value></param></params></methodResponse>
1159 $r = $s->parseResponse($f);
1160 $v = $r->faultCode();
1161 $this->assertEquals(2, $v);
1164 function testAutodecodeResponse()
1166 $s = new xmlrpcmsg('dummy');
1167 $f = '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
1168 <member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>hello world. 2 newlines follow
1171 and there they were.</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
1173 $r = $s->parseResponse($f, true, 'phpvals');
1176 $this->assertEquals("hello world. 2 newlines follow\n\n\nand there they were.", $s);
1179 function testNoDecodeResponse()
1181 $s = new xmlrpcmsg('dummy');
1182 $f = '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
1183 <member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>hello world. 2 newlines follow
1186 and there they were.</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>';
1187 $r = $s->parseResponse($f, true, 'xml');
1189 $this->assertEquals($f, $v);
1192 function testAutoCoDec()
1194 $data1 = array(1, 1.0, 'hello world', true, '20051021T23:43:00', -1, 11.0, '~!@#$%^&*()_+|', false, '20051021T23:43:00');
1195 $data2 = array('zero' => $data1, 'one' => $data1, 'two' => $data1, 'three' => $data1, 'four' => $data1, 'five' => $data1, 'six' => $data1, 'seven' => $data1, 'eight' => $data1, 'nine' => $data1);
1196 $data = array($data2, $data2, $data2, $data2, $data2, $data2, $data2, $data2, $data2, $data2);
1197 //$keys = array('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');
1198 $v1 = php_xmlrpc_encode($data, array('auto_dates'));
1199 $v2 = php_xmlrpc_decode_xml($v1->serialize());
1200 $this->assertEquals($v1, $v2);
1201 $r1 = new xmlrpcresp($v1);
1202 $r2 = php_xmlrpc_decode_xml($r1->serialize());
1203 $r2->serialize(); // needed to set internal member payload
1204 $this->assertEquals($r1, $r2);
1205 $m1 = new xmlrpcmsg('hello dolly', array($v1));
1206 $m2 = php_xmlrpc_decode_xml($m1->serialize());
1207 $m2->serialize(); // needed to set internal member payload
1208 $this->assertEquals($m1, $m2);
1211 function testUTF8Request()
1213 $sendstring='κόσμε'; // Greek word 'kosme'. NB: NOT a valid ISO8859 string!
1214 $GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
1215 $f = new xmlrpcval($sendstring, 'string');
1217 $this->assertEquals("<value><string>κόσμε</string></value>\n", $v);
1218 $GLOBALS['xmlrpc_internalencoding'] = 'ISO-8859-1';
1221 function testUTF8Response()
1223 $s = new xmlrpcmsg('dummy');
1224 $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
1225 <member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>'.utf8_encode('������').'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
1227 $r = $s->parseResponse($f, false, 'phpvals');
1230 $this->assertEquals("������", $v);
1231 $f = '<?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
1232 <member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>'.utf8_encode('������').'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
1234 $r = $s->parseResponse($f, false, 'phpvals');
1237 $this->assertEquals("������", $v);
1240 function testUTF8IntString()
1242 $v=new xmlrpcval(100, 'int');
1243 $s=$v->serialize('UTF-8');
1244 $this->assertequals("<value><int>100</int></value>\n", $s);
1247 function testStringInt()
1249 $v=new xmlrpcval('hello world', 'int');
1251 $this->assertequals("<value><int>0</int></value>\n", $s);
1254 function testStructMemExists()
1256 $v=php_xmlrpc_encode(array('hello' => 'world'));
1257 $b=$v->structmemexists('hello');
1258 $this->assertequals(true, $b);
1259 $b=$v->structmemexists('world');
1260 $this->assertequals(false, $b);
1263 function testNilvalue()
1265 // default case: we do not accept nil values received
1266 $v = new xmlrpcval('hello', 'null');
1267 $r = new xmlrpcresp($v);
1268 $s = $r->serialize();
1269 $m = new xmlrpcmsg('dummy');
1270 $r = $m->parseresponse($s);
1271 $this->assertequals(2, $r->faultCode());
1272 // enable reception of nil values
1273 $GLOBALS['xmlrpc_null_extension'] = true;
1274 $r = $m->parseresponse($s);
1276 $this->assertequals('null', $v->scalartyp());
1277 // test with the apache version: EX:NIL
1278 $GLOBALS['xmlrpc_null_apache_encoding'] = true;
1280 $v = new xmlrpcval('hello', 'null');
1281 $s = $v->serialize();
1282 $this->assertequals(1, preg_match( '#<value><ex:nil/></value>#', $s ));
1284 $r = new xmlrpcresp($v);
1285 $s = $r->serialize();
1286 $r = $m->parseresponse($s);
1288 $this->assertequals('null', $v->scalartyp());
1289 $GLOBALS['xmlrpc_null_extension'] = false;
1290 $r = $m->parseresponse($s);
1291 $this->assertequals(2, $r->faultCode());
1294 function TestLocale()
1296 $locale = setlocale(LC_NUMERIC, 0);
1297 /// @todo on php 5.3/win setting locale to german does not seem to set decimal separator to comma...
1298 if (setlocale(LC_NUMERIC,'deu', 'de_DE@euro', 'de_DE', 'de', 'ge') !== false)
1300 $v = new xmlrpcval(1.1, 'double');
1301 if (strpos($v->scalarval(), ',') == 1)
1303 $r = $v->serialize();
1304 $this->assertequals(false, strpos($r, ','));
1306 setlocale(LC_NUMERIC, $locale);
1311 class InvalidHostTests extends PHPUnit_TestCase
1317 global $DEBUG,$LOCALSERVER;
1318 $this->client=new xmlrpc_client('/NOTEXIST.php', $LOCALSERVER, 80);
1321 $this->client->setDebug($DEBUG);
1327 $f = new xmlrpcmsg('examples.echo',array(
1328 new xmlrpcval('hello', 'string')
1330 $r = $this->client->send($f, 5);
1331 $this->assertEquals(5, $r->faultCode());
1334 function testSrvNotFound()
1336 $f = new xmlrpcmsg('examples.echo',array(
1337 new xmlrpcval('hello', 'string')
1339 $this->client->server .= 'XXX';
1340 $r = $this->client->send($f, 5);
1341 $this->assertEquals(5, $r->faultCode());
1344 function testCurlKAErr()
1346 global $LOCALSERVER, $URI;
1347 if(!function_exists('curl_init'))
1349 $this->fail('CURL missing: cannot test curl keepalive errors');
1352 $f = new xmlrpcmsg('examples.stringecho',array(
1353 new xmlrpcval('hello', 'string')
1355 // test 2 calls w. keepalive: 1st time connection ko, second time ok
1356 $this->client->server .= 'XXX';
1357 $this->client->keepalive = true;
1358 $r = $this->client->send($f, 5, 'http11');
1359 // in case we have a "universal dns resolver" getting in the way, we might get a 302 instead of a 404
1360 $this->assertTrue($r->faultCode() === 8 || $r->faultCode() == 5);
1362 // now test a successful connection
1363 $server = explode(':', $LOCALSERVER);
1364 if(count($server) > 1)
1366 $this->client->port = $server[1];
1368 $this->client->server = $server[0];
1369 $this->client->path = $URI;
1371 $r = $this->client->send($f, 5, 'http11');
1372 $this->assertEquals(0, $r->faultCode());
1374 is_object( $ro ) && $this->assertEquals('hello', $ro->scalarVal());
1379 $suite->addTest(new LocalhostTests('testString'));
1380 $suite->addTest(new LocalhostTests('testAdding'));
1381 $suite->addTest(new LocalhostTests('testAddingDoubles'));
1382 $suite->addTest(new LocalhostTests('testInvalidNumber'));
1383 $suite->addTest(new LocalhostTests('testBoolean'));
1384 $suite->addTest(new LocalhostTests('testCountEntities'));
1385 $suite->addTest(new LocalhostTests('testBase64'));
1386 $suite->addTest(new LocalhostTests('testDateTime'));
1387 $suite->addTest(new LocalhostTests('testServerMulticall'));
1388 $suite->addTest(new LocalhostTests('testClientMulticall1'));
1389 $suite->addTest(new LocalhostTests('testClientMulticall2'));
1390 $suite->addTest(new LocalhostTests('testClientMulticall3'));
1391 $suite->addTest(new LocalhostTests('testCatchWarnings'));
1392 $suite->addTest(new LocalhostTests('testCatchExceptions'));
1393 $suite->addTest(new LocalhostTests('testZeroParams'));
1394 $suite->addTest(new LocalhostTests('testCodeInjectionServerSide'));
1395 $suite->addTest(new LocalhostTests('testAutoRegisteredFunction'));
1396 $suite->addTest(new LocalhostTests('testAutoRegisteredMethod'));
1397 $suite->addTest(new LocalhostTests('testSetCookies'));
1398 $suite->addTest(new LocalhostTests('testGetCookies'));
1399 $suite->addTest(new LocalhostTests('testSendTwiceSameMsg'));
1401 $suite->addTest(new LocalhostMultiTests('testUTF8Requests'));
1402 $suite->addTest(new LocalhostMultiTests('testUTF8Responses'));
1403 $suite->addTest(new LocalhostMultiTests('testISORequests'));
1404 $suite->addTest(new LocalhostMultiTests('testISOResponses'));
1405 $suite->addTest(new LocalhostMultiTests('testGzip'));
1406 $suite->addTest(new LocalhostMultiTests('testDeflate'));
1407 $suite->addTest(new LocalhostMultiTests('testProxy'));
1408 $suite->addTest(new LocalhostMultiTests('testHttp11'));
1409 $suite->addTest(new LocalhostMultiTests('testHttp11Gzip'));
1410 $suite->addTest(new LocalhostMultiTests('testHttp11Deflate'));
1411 $suite->addTest(new LocalhostMultiTests('testKeepAlives'));
1412 $suite->addTest(new LocalhostMultiTests('testHttp11Proxy'));
1413 $suite->addTest(new LocalhostMultiTests('testHttps'));
1414 $suite->addTest(new LocalhostMultiTests('testHttpsProxy'));
1416 $suite->addTest(new InvalidHostTests('test404'));
1417 //$suite->addTest(new InvalidHostTests('testSrvNotFound'));
1418 $suite->addTest(new InvalidHostTests('testCurlKAErr'));
1420 $suite->addTest(new ParsingBugsTests('testMinusOneString'));
1421 $suite->addTest(new ParsingBugsTests('testUnicodeInMemberName'));
1422 $suite->addTest(new ParsingBugsTests('testUnicodeInErrorString'));
1423 $suite->addTest(new ParsingBugsTests('testValidNumbers'));
1424 $suite->addTest(new ParsingBugsTests('testAddScalarToStruct'));
1425 $suite->addTest(new ParsingBugsTests('testAddStructToStruct'));
1426 $suite->addTest(new ParsingBugsTests('testAddArrayToArray'));
1427 $suite->addTest(new ParsingBugsTests('testEncodeArray'));
1428 $suite->addTest(new ParsingBugsTests('testEncodeRecursive'));
1429 $suite->addTest(new ParsingBugsTests('testBrokenrequests'));
1430 $suite->addTest(new ParsingBugsTests('testBrokenresponses'));
1431 $suite->addTest(new ParsingBugsTests('testBuggyHttp'));
1432 $suite->addTest(new ParsingBugsTests('testStringBug'));
1433 $suite->addTest(new ParsingBugsTests('testWhiteSpace'));
1434 $suite->addTest(new ParsingBugsTests('testAutodecodeResponse'));
1435 $suite->addTest(new ParsingBugsTests('testNoDecodeResponse'));
1436 $suite->addTest(new ParsingBugsTests('testAutoCoDec'));
1437 $suite->addTest(new ParsingBugsTests('testUTF8Response'));
1438 $suite->addTest(new ParsingBugsTests('testUTF8Request'));
1439 $suite->addTest(new ParsingBugsTests('testUTF8IntString'));
1440 $suite->addTest(new ParsingBugsTests('testStringInt'));
1441 $suite->addTest(new ParsingBugsTests('testStructMemExists'));
1442 $suite->addTest(new ParsingBugsTests('testDoubleDataInArrayTag'));
1443 $suite->addTest(new ParsingBugsTests('testDoubleStuffInValueTag'));
1444 $suite->addTest(new ParsingBugsTests('testNilValue'));
1445 $suite->addTest(new ParsingBugsTests('testLocale'));
1447 $title = 'XML-RPC Unit Tests';
1451 $suite = new PHPUnit_TestSuite($only);
1454 if(isset($_SERVER['REQUEST_METHOD']))
1456 echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n<head>\n<title>$title</title>\n</head>\n<body>\n<h1>$title</h1>\n";
1463 if(isset($_SERVER['REQUEST_METHOD']))
1465 echo "<h3>Using lib version: $xmlrpcVersion on PHP version: ".phpversion()."</h3>\n";
1466 echo '<h3>Running '.$suite->testCount().' tests (some of which are multiple) against servers: http://'.htmlspecialchars($LOCALSERVER.$URI).' and https://'.htmlspecialchars($HTTPSSERVER.$HTTPSURI)."\n ...</h3>\n";
1472 echo "Using lib version: $xmlrpcVersion on PHP version: ".phpversion()."\n";
1473 echo 'Running '.$suite->testCount().' tests (some of which are multiple) against servers: http://'.$LOCALSERVER.$URI.' and https://'.$HTTPSSERVER.$HTTPSURI."\n\n";
1476 // do some basic timing measurement
1477 list($micro, $sec) = explode(' ', microtime());
1478 $start_time = $sec + $micro;
1480 $PHPUnit = new PHPUnit;
1481 $result = $PHPUnit->run($suite, ($DEBUG == 0 ? '.' : '<hr/>'));
1483 list($micro, $sec) = explode(' ', microtime());
1484 $end_time = $sec + $micro;
1486 if(!isset($_SERVER['REQUEST_METHOD']))
1488 echo $result->toString()."\n";
1491 if(isset($_SERVER['REQUEST_METHOD']))
1493 echo '<h3>'.$result->failureCount()." test failures</h3>\n";
1494 printf("Time spent: %.2f secs<br/>\n", $end_time - $start_time);
1498 echo $result->failureCount()." test failures\n";
1499 printf("Time spent: %.2f secs\n", $end_time - $start_time);
1502 if($result->failureCount() && !$DEBUG)
1504 $target = strpos($_SERVER['PHP_SELF'], '?') ? $_SERVER['PHP_SELF'].'&DEBUG=1' : $_SERVER['PHP_SELF'].'?DEBUG=1';
1505 $t2 = strpos($_SERVER['PHP_SELF'], '?') ? $_SERVER['PHP_SELF'].'&DEBUG=2' : $_SERVER['PHP_SELF'].'?DEBUG=2';
1506 if(isset($_SERVER['REQUEST_METHOD']))
1508 echo '<p>Run testsuite with <a href="'.$target.'">DEBUG=1</a> to have more detail about tests results. Or with <a href="'.$t2.'">DEBUG=2</a> for even more.</p>'."\n";
1512 echo "Run testsuite with DEBUG=1 (or 2) to have more detail about tests results\n";
1516 if(isset($_SERVER['REQUEST_METHOD']))
1519 <a href="#" onclick="if (document.getElementById('opts').style.display == 'block') document.getElementById('opts').style.display = 'none'; else document.getElementById('opts').style.display = 'block';">More options...</a>
1520 <div id="opts" style="display: none;">
1521 <form method="GET" style="border: 1px solid silver; margin: 5px; padding: 5px; font-family: monospace;">
1522 HTTP Server: <input name="LOCALSERVER" size="30" value="<?php echo htmlspecialchars($LOCALSERVER); ?>"/> Path: <input name="URI" size="30" value="<?php echo htmlspecialchars($URI); ?>"/><br/>
1523 HTTPS Server: <input name="HTTPSSERVER" size="30" value="<?php echo htmlspecialchars($HTTPSSERVER); ?>"/> Path: <input name="HTTPSURI" size="30" value="<?php echo htmlspecialchars($HTTPSURI); ?>"/> Do not verify cert: <input name="HTTPSIGNOREPEER" value="true" type="checkbox" <?php if ($HTTPSIGNOREPEER) echo 'checked="checked"'; ?>/><br/>
1525 Proxy Server: <input name="PROXY" size="30" value="<?php echo isset($PROXY) ? htmlspecialchars($PROXY) : ''; ?>"/> <input type="submit" value="Run Testsuite"/>
1529 echo $result->toHTML()."\n</body>\n</html>\n";