From: gggeek Date: Sat, 21 Feb 2015 19:04:06 +0000 (+0000) Subject: Reformat source code: tests X-Git-Tag: 4.0.0-alpha^2~187 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b4494505561b0493c01610dd09f23b6c2efa6797;p=plcapi.git Reformat source code: tests --- diff --git a/tests/InvalidHostTest.php b/tests/InvalidHostTest.php index fb89b432..1ac111f7 100644 --- a/tests/InvalidHostTest.php +++ b/tests/InvalidHostTest.php @@ -1,62 +1,58 @@ args = argParser::getArgs(); $this->client = new xmlrpc_client('/NOTEXIST.php', $this->args['LOCALSERVER'], 80); - if($this->args['DEBUG']) - { + if ($this->args['DEBUG']) { $this->client->setDebug($this->args['DEBUG']); } } - function test404() + public function test404() { - $f = new xmlrpcmsg('examples.echo',array( - new xmlrpcval('hello', 'string') + $f = new xmlrpcmsg('examples.echo', array( + new xmlrpcval('hello', 'string'), )); $r = $this->client->send($f, 5); $this->assertEquals(5, $r->faultCode()); } - function testSrvNotFound() + public function testSrvNotFound() { - $f = new xmlrpcmsg('examples.echo',array( - new xmlrpcval('hello', 'string') + $f = new xmlrpcmsg('examples.echo', array( + new xmlrpcval('hello', 'string'), )); $this->client->server .= 'XXX'; $r = $this->client->send($f, 5); // make sure there's no freaking catchall DNS in effect $dnsinfo = dns_get_record($this->client->server); - if($dnsinfo) - { + if ($dnsinfo) { $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found'); - } - else - { + } else { $this->assertEquals(5, $r->faultCode()); } } - function testCurlKAErr() + public function testCurlKAErr() { - if(!function_exists('curl_init')) - { + if (!function_exists('curl_init')) { $this->markTestSkipped('CURL missing: cannot test curl keepalive errors'); + return; } - $f = new xmlrpcmsg('examples.stringecho',array( - new xmlrpcval('hello', 'string') + $f = new xmlrpcmsg('examples.stringecho', array( + new xmlrpcval('hello', 'string'), )); // test 2 calls w. keepalive: 1st time connection ko, second time ok $this->client->server .= 'XXX'; @@ -67,8 +63,7 @@ class InvalidHostTest extends PHPUnit_Framework_TestCase // now test a successful connection $server = explode(':', $this->args['LOCALSERVER']); - if(count($server) > 1) - { + if (count($server) > 1) { $this->client->port = $server[1]; } $this->client->server = $server[0]; @@ -77,6 +72,6 @@ class InvalidHostTest extends PHPUnit_Framework_TestCase $r = $this->client->send($f, 5, 'http11'); $this->assertEquals(0, $r->faultCode()); $ro = $r->value(); - is_object( $ro ) && $this->assertEquals('hello', $ro->scalarVal()); + is_object($ro) && $this->assertEquals('hello', $ro->scalarVal()); } } diff --git a/tests/LocalhostTest.php b/tests/LocalhostTest.php index 3078960c..ec2ad1ec 100644 --- a/tests/LocalhostTest.php +++ b/tests/LocalhostTest.php @@ -1,31 +1,28 @@ args = argParser::getArgs(); $server = explode(':', $this->args['LOCALSERVER']); - if(count($server) > 1) - { - $this->client=new xmlrpc_client($this->args['URI'], $server[0], $server[1]); + if (count($server) > 1) { + $this->client = new xmlrpc_client($this->args['URI'], $server[0], $server[1]); + } else { + $this->client = new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']); } - else - { - $this->client=new xmlrpc_client($this->args['URI'], $this->args['LOCALSERVER']); - } - if($this->args['DEBUG']) - { + if ($this->args['DEBUG']) { $this->client->setDebug($this->args['DEBUG']); } $this->client->request_compression = $this->request_compression; $this->client->accepted_compression = $this->accepted_compression; } - function send($msg, $errrorcode=0, $return_response=false) + public function send($msg, $errrorcode = 0, $return_response = false) { $r = $this->client->send($msg, $this->timeout, $this->method); // for multicall, return directly array of responses - if(is_array($r)) - { + if (is_array($r)) { return $r; } - $this->assertEquals($r->faultCode(), $errrorcode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); - if(!$r->faultCode()) - { - if($return_response) + $this->assertEquals($r->faultCode(), $errrorcode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); + if (!$r->faultCode()) { + if ($return_response) { return $r; - else + } else { return $r->value(); - } - else - { - return null; + } + } else { + return; } } - function testString() + public function testString() { - $sendstring="here are 3 \"entities\": < > & " . + $sendstring = "here are 3 \"entities\": < > & " . "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . " - isn't that great? \\\"hackery\\\" at it's best " . - " also don't want to miss out on \$item[0]. ". - "The real weird stuff follows: CRLF here".chr(13).chr(10). - "a simple CR here".chr(13). - "a simple LF here".chr(10). - "and then LFCR".chr(10).chr(13). - "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; - $f=new xmlrpcmsg('examples.stringecho', array( - new xmlrpcval($sendstring, 'string') + " also don't want to miss out on \$item[0]. " . + "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . + "a simple CR here" . chr(13) . + "a simple LF here" . chr(10) . + "and then LFCR" . chr(10) . chr(13) . + "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; + $f = new xmlrpcmsg('examples.stringecho', array( + new xmlrpcval($sendstring, 'string'), )); - $v=$this->send($f); - if($v) - { + $v = $this->send($f); + if ($v) { // when sending/receiving non-US-ASCII encoded strings, XML says cr-lf can be normalized. // so we relax our tests... $l1 = strlen($sendstring); $l2 = strlen($v->scalarval()); - if ($l1 == $l2) + if ($l1 == $l2) { $this->assertEquals($sendstring, $v->scalarval()); - else + } else { $this->assertEquals(str_replace(array("\r\n", "\r"), array("\n", "\n"), $sendstring), $v->scalarval()); + } } } - function testAddingDoubles() + public function testAddingDoubles() { // note that rounding errors mean we // keep precision to sensible levels here ;-) - $a=12.13; $b=-23.98; - $f=new xmlrpcmsg('examples.addtwodouble',array( + $a = 12.13; + $b = -23.98; + $f = new xmlrpcmsg('examples.addtwodouble', array( new xmlrpcval($a, 'double'), - new xmlrpcval($b, 'double') + new xmlrpcval($b, 'double'), )); - $v=$this->send($f); - if($v) - { - $this->assertEquals($a+$b,$v->scalarval()); + $v = $this->send($f); + if ($v) { + $this->assertEquals($a + $b, $v->scalarval()); } } - function testAdding() + public function testAdding() { - $f=new xmlrpcmsg('examples.addtwo',array( + $f = new xmlrpcmsg('examples.addtwo', array( new xmlrpcval(12, 'int'), - new xmlrpcval(-23, 'int') + new xmlrpcval(-23, 'int'), )); - $v=$this->send($f); - if($v) - { - $this->assertEquals(12-23, $v->scalarval()); + $v = $this->send($f); + if ($v) { + $this->assertEquals(12 - 23, $v->scalarval()); } } - function testInvalidNumber() + public function testInvalidNumber() { - $f=new xmlrpcmsg('examples.addtwo',array( + $f = new xmlrpcmsg('examples.addtwo', array( new xmlrpcval('fred', 'int'), - new xmlrpcval("\"; exec('ls')", 'int') + new xmlrpcval("\"; exec('ls')", 'int'), )); - $v=$this->send($f); + $v = $this->send($f); /// @todo a fault condition should be generated here /// by the server, which we pick up on - if($v) - { + if ($v) { $this->assertEquals(0, $v->scalarval()); } } - function testBoolean() + public function testBoolean() { - $f=new xmlrpcmsg('examples.invertBooleans', array( + $f = new xmlrpcmsg('examples.invertBooleans', array( new xmlrpcval(array( new xmlrpcval(true, 'boolean'), new xmlrpcval(false, 'boolean'), @@ -164,33 +152,28 @@ class LocalhostTest extends PHPUnit_Framework_TestCase //new xmlrpcval('true', 'boolean'), //new xmlrpcval('false', 'boolean') ), - 'array' - ))); - $answer='0101'; - $v=$this->send($f); - if($v) - { - $sz=$v->arraysize(); - $got=''; - for($i=0; $i<$sz; $i++) - { - $b=$v->arraymem($i); - if($b->scalarval()) - { - $got.='1'; - } - else - { - $got.='0'; + 'array' + ),)); + $answer = '0101'; + $v = $this->send($f); + if ($v) { + $sz = $v->arraysize(); + $got = ''; + for ($i = 0; $i < $sz; $i++) { + $b = $v->arraymem($i); + if ($b->scalarval()) { + $got .= '1'; + } else { + $got .= '0'; } } $this->assertEquals($answer, $got); } } - function testBase64() + public function testBase64() { - $sendstring='Mary had a little lamb, + $sendstring = 'Mary had a little lamb, Whose fleece was white as snow, And everywhere that Mary went the lamb was sure to go. @@ -199,51 +182,47 @@ Mary had a little lamb She tied it to a pylon Ten thousand volts went down its back And turned it into nylon'; - $f=new xmlrpcmsg('examples.decode64',array( - new xmlrpcval($sendstring, 'base64') + $f = new xmlrpcmsg('examples.decode64', array( + new xmlrpcval($sendstring, 'base64'), )); - $v=$this->send($f); - if($v) - { - if (strlen($sendstring) == strlen($v->scalarval())) + $v = $this->send($f); + if ($v) { + if (strlen($sendstring) == strlen($v->scalarval())) { $this->assertEquals($sendstring, $v->scalarval()); - else + } else { $this->assertEquals(str_replace(array("\r\n", "\r"), array("\n", "\n"), $sendstring), $v->scalarval()); + } } } - function testDateTime() + public function testDateTime() { $time = time(); $t1 = new xmlrpcval($time, 'dateTime.iso8601'); $t2 = new xmlrpcval(iso8601_encode($time), 'dateTime.iso8601'); $this->assertEquals($t1->serialize(), $t2->serialize()); - if (class_exists('DateTime')) - { + if (class_exists('DateTime')) { $datetime = new DateTime(); // skip this test for php 5.2. It is a bit harder there to build a DateTime from unix timestamp with proper TZ info - if(is_callable(array($datetime,'setTimestamp'))) - { + if (is_callable(array($datetime, 'setTimestamp'))) { $t3 = new xmlrpcval($datetime->setTimestamp($time), 'dateTime.iso8601'); $this->assertEquals($t1->serialize(), $t3->serialize()); } } } - function testCountEntities() + public function testCountEntities() { $sendstring = "h'fd>onc>>l>>rw&bpu>q>esend($f); - if($v) - { + if ($v) { $got = ''; $expected = '37210'; - $expect_array = array('ctLeftAngleBrackets','ctRightAngleBrackets','ctAmpersands','ctApostrophes','ctQuotes'); - while(list(,$val) = each($expect_array)) - { + $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes'); + while (list(, $val) = each($expect_array)) { $b = $v->structmem($val); $got .= $b->me['int']; } @@ -251,14 +230,15 @@ And turned it into nylon'; } } - function _multicall_msg($method, $params) + public function _multicall_msg($method, $params) { $struct['methodName'] = new xmlrpcval($method, 'string'); $struct['params'] = new xmlrpcval($params, 'array'); + return new xmlrpcval($struct, 'struct'); } - function testServerMulticall() + public function testServerMulticall() { // We manually construct a system.multicall() call to ensure // that the server supports it. @@ -285,8 +265,7 @@ And turned it into nylon'; $f = new xmlrpcmsg('system.multicall', array($arg)); $v = $this->send($f); - if($v) - { + if ($v) { //$this->assertTrue($r->faultCode() == 0, "fault from system.multicall"); $this->assertTrue($v->arraysize() == 4, "bad number of return values"); @@ -316,7 +295,7 @@ And turned it into nylon'; } } - function testClientMulticall1() + public function testClientMulticall1() { // NB: This test will NOT pass if server does not support system.multicall. @@ -333,14 +312,12 @@ And turned it into nylon'; ); $r = $this->send(array($good1, $bad, $recursive, $good2)); - if($r) - { + if ($r) { $this->assertTrue(count($r) == 4, "wrong number of return values"); } $this->assertTrue($r[0]->faultCode() == 0, "fault from good1"); - if(!$r[0]->faultCode()) - { + if (!$r[0]->faultCode()) { $val = $r[0]->value(); $this->assertTrue( $val->kindOf() == 'scalar' && $val->scalartyp() == 'string', @@ -350,8 +327,7 @@ And turned it into nylon'; $this->assertTrue($r[1]->faultCode() != 0, "no fault from bad"); $this->assertTrue($r[2]->faultCode() != 0, "no fault from recursive system.multicall"); $this->assertTrue($r[3]->faultCode() == 0, "fault from good2"); - if(!$r[3]->faultCode()) - { + if (!$r[3]->faultCode()) { $val = $r[3]->value(); $this->assertTrue($val->kindOf() == 'array', "good2 did not return array"); } @@ -362,7 +338,7 @@ And turned it into nylon'; ); } - function testClientMulticall2() + public function testClientMulticall2() { // NB: This test will NOT pass if server does not support system.multicall. @@ -379,14 +355,12 @@ And turned it into nylon'; ); $r = $this->send(array($good1, $bad, $recursive, $good2)); - if($r) - { + if ($r) { $this->assertTrue(count($r) == 4, "wrong number of return values"); } $this->assertTrue($r[0]->faultCode() == 0, "fault from good1"); - if(!$r[0]->faultCode()) - { + if (!$r[0]->faultCode()) { $val = $r[0]->value(); $this->assertTrue( $val->kindOf() == 'scalar' && $val->scalartyp() == 'string', @@ -395,14 +369,13 @@ And turned it into nylon'; $this->assertTrue($r[1]->faultCode() != 0, "no fault from bad"); $this->assertTrue($r[2]->faultCode() == 0, "fault from (non recursive) system.multicall"); $this->assertTrue($r[3]->faultCode() == 0, "fault from good2"); - if(!$r[3]->faultCode()) - { + if (!$r[3]->faultCode()) { $val = $r[3]->value(); $this->assertTrue($val->kindOf() == 'array', "good2 did not return array"); } } - function testClientMulticall3() + public function testClientMulticall3() { // NB: This test will NOT pass if server does not support system.multicall. @@ -420,190 +393,169 @@ And turned it into nylon'; ); $r = $this->send(array($good1, $bad, $recursive, $good2)); - if($r) - { + if ($r) { $this->assertTrue(count($r) == 4, "wrong number of return values"); } $this->assertTrue($r[0]->faultCode() == 0, "fault from good1"); - if(!$r[0]->faultCode()) - { + if (!$r[0]->faultCode()) { $val = $r[0]->value(); $this->assertTrue( - is_string($val) , "good1 did not return string"); + is_string($val), "good1 did not return string"); } $this->assertTrue($r[1]->faultCode() != 0, "no fault from bad"); $this->assertTrue($r[2]->faultCode() != 0, "no fault from recursive system.multicall"); $this->assertTrue($r[3]->faultCode() == 0, "fault from good2"); - if(!$r[3]->faultCode()) - { + if (!$r[3]->faultCode()) { $val = $r[3]->value(); $this->assertTrue(is_array($val), "good2 did not return array"); } $this->client->return_type = 'xmlrpcvals'; } - function testCatchWarnings() + public function testCatchWarnings() { $f = new xmlrpcmsg('examples.generatePHPWarning', array( - new xmlrpcval('whatever', 'string') + new xmlrpcval('whatever', 'string'), )); $v = $this->send($f); - if($v) - { + if ($v) { $this->assertEquals($v->scalarval(), true); } } - function testCatchExceptions() + public function testCatchExceptions() { $f = new xmlrpcmsg('examples.raiseException', array( - new xmlrpcval('whatever', 'string') + new xmlrpcval('whatever', 'string'), )); $v = $this->send($f, $GLOBALS['xmlrpcerr']['server_error']); - $this->client->path = $this->args['URI'].'?EXCEPTION_HANDLING=1'; + $this->client->path = $this->args['URI'] . '?EXCEPTION_HANDLING=1'; $v = $this->send($f, 1); - $this->client->path = $this->args['URI'].'?EXCEPTION_HANDLING=2'; + $this->client->path = $this->args['URI'] . '?EXCEPTION_HANDLING=2'; $v = $this->send($f, $GLOBALS['xmlrpcerr']['invalid_return']); } - function testZeroParams() + public function testZeroParams() { $f = new xmlrpcmsg('system.listMethods'); $v = $this->send($f); } - function testCodeInjectionServerSide() + public function testCodeInjectionServerSide() { $f = new xmlrpcmsg('system.MethodHelp'); $f->payload = "validator1.echoStructTest','')); echo('gotcha!'); die(); //"; $v = $this->send($f); //$v = $r->faultCode(); - if ($v) - { + if ($v) { $this->assertEquals(0, $v->structsize()); } } - function testAutoRegisteredFunction() + public function testAutoRegisteredFunction() { - $f=new xmlrpcmsg('examples.php.getStateName',array( - new xmlrpcval(23, 'int') + $f = new xmlrpcmsg('examples.php.getStateName', array( + new xmlrpcval(23, 'int'), )); - $v=$this->send($f); - if($v) - { + $v = $this->send($f); + if ($v) { $this->assertEquals('Michigan', $v->scalarval()); - } - else - { + } else { $this->fail('Note: server can only auto register functions if running with PHP 5.0.3 and up'); } } - function testAutoRegisteredClass() + public function testAutoRegisteredClass() { - $f=new xmlrpcmsg('examples.php2.getStateName',array( - new xmlrpcval(23, 'int') + $f = new xmlrpcmsg('examples.php2.getStateName', array( + new xmlrpcval(23, 'int'), )); - $v=$this->send($f); - if($v) - { + $v = $this->send($f); + if ($v) { $this->assertEquals('Michigan', $v->scalarval()); - $f=new xmlrpcmsg('examples.php3.getStateName',array( - new xmlrpcval(23, 'int') - )); - $v=$this->send($f); - if($v) - { + $f = new xmlrpcmsg('examples.php3.getStateName', array( + new xmlrpcval(23, 'int'), + )); + $v = $this->send($f); + if ($v) { $this->assertEquals('Michigan', $v->scalarval()); } - } - else - { + } else { $this->fail('Note: server can only auto register class methods if running with PHP 5.0.3 and up'); } } - function testAutoRegisteredMethod() + public function testAutoRegisteredMethod() { // make a 'deep client copy' as the original one might have many properties set - $func=wrap_xmlrpc_method($this->client, 'examples.getStateName', array('simple_client_copy' => 1)); - if($func == '') - { + $func = wrap_xmlrpc_method($this->client, 'examples.getStateName', array('simple_client_copy' => 1)); + if ($func == '') { $this->fail('Registration of examples.getStateName failed'); - } - else - { - $v=$func(23); + } else { + $v = $func(23); // work around bug in current version of phpunit - if(is_object($v)) - { + if (is_object($v)) { $v = var_export($v, true); } $this->assertEquals('Michigan', $v); } } - function testGetCookies() + public function testGetCookies() { // let server set to us some cookies we tell it $cookies = array( //'c1' => array(), 'c2' => array('value' => 'c2'), - 'c3' => array('value' => 'c3', 'expires' => time()+60*60*24*30), - 'c4' => array('value' => 'c4', 'expires' => time()+60*60*24*30, 'path' => '/'), - 'c5' => array('value' => 'c5', 'expires' => time()+60*60*24*30, 'path' => '/', 'domain' => 'localhost'), + 'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30), + 'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'), + 'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), ); $cookiesval = php_xmlrpc_encode($cookies); - $f=new xmlrpcmsg('examples.setcookies',array($cookiesval)); - $r=$this->send($f, 0, true); - if($r) - { + $f = new xmlrpcmsg('examples.setcookies', array($cookiesval)); + $r = $this->send($f, 0, true); + if ($r) { $v = $r->value(); $this->assertEquals(1, $v->scalarval()); // now check if we decoded the cookies as we had set them $rcookies = $r->cookies(); // remove extra cookies which might have been set by proxies - foreach($rcookies as $c => $v) - if(!in_array($c, array('c2', 'c3', 'c4', 'c5'))) + foreach ($rcookies as $c => $v) { + if (!in_array($c, array('c2', 'c3', 'c4', 'c5'))) { unset($rcookies[$c]); - foreach($cookies as $c => $v) - // format for date string in cookies: 'Mon, 31 Oct 2005 13:50:56 GMT' + } + } + foreach ($cookies as $c => $v) {// format for date string in cookies: 'Mon, 31 Oct 2005 13:50:56 GMT' // but PHP versions differ on that, some use 'Mon, 31-Oct-2005 13:50:56 GMT'... - if(isset($v['expires'])) - { - if (isset($rcookies[$c]['expires']) && strpos($rcookies[$c]['expires'], '-')) - { - $cookies[$c]['expires'] = gmdate('D, d\-M\-Y H:i:s \G\M\T' ,$cookies[$c]['expires']); - } - else - { - $cookies[$c]['expires'] = gmdate('D, d M Y H:i:s \G\M\T' ,$cookies[$c]['expires']); + if (isset($v['expires'])) { + if (isset($rcookies[$c]['expires']) && strpos($rcookies[$c]['expires'], '-')) { + $cookies[$c]['expires'] = gmdate('D, d\-M\-Y H:i:s \G\M\T', $cookies[$c]['expires']); + } else { + $cookies[$c]['expires'] = gmdate('D, d M Y H:i:s \G\M\T', $cookies[$c]['expires']); } } - $this->assertEquals($cookies, $rcookies); + $this->assertEquals($cookies, $rcookies); + } } } - function testSetCookies() + public function testSetCookies() { // let server set to us some cookies we tell it $cookies = array( 'c0' => null, 'c1' => 1, 'c2' => '2 3', - 'c3' => '!@#$%^&*()_+|}{":?><,./\';[]\\=-' + 'c3' => '!@#$%^&*()_+|}{":?><,./\';[]\\=-', ); - $f=new xmlrpcmsg('examples.getcookies',array()); - foreach ($cookies as $cookie => $val) - { + $f = new xmlrpcmsg('examples.getcookies', array()); + foreach ($cookies as $cookie => $val) { $this->client->setCookie($cookie, $val); - $cookies[$cookie] = (string) $cookies[$cookie]; + $cookies[$cookie] = (string)$cookies[$cookie]; } $r = $this->client->send($f, $this->timeout, $this->method); - $this->assertEquals($r->faultCode(), 0, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); - if(!$r->faultCode()) - { + $this->assertEquals($r->faultCode(), 0, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); + if (!$r->faultCode()) { $v = $r->value(); $v = php_xmlrpc_decode($v); // on IIS and Apache getallheaders returns something slightly different... @@ -611,17 +563,16 @@ And turned it into nylon'; } } - function testSendTwiceSameMsg() + public function testSendTwiceSameMsg() { - $f=new xmlrpcmsg('examples.stringecho', array( - new xmlrpcval('hello world', 'string') + $f = new xmlrpcmsg('examples.stringecho', array( + new xmlrpcval('hello world', 'string'), )); $v1 = $this->send($f); $v2 = $this->send($f); //$v = $r->faultCode(); - if ($v1 && $v2) - { + if ($v1 && $v2) { $this->assertEquals($v2, $v1); } } -} \ No newline at end of file +} diff --git a/tests/ParsingBugsTest.php b/tests/ParsingBugsTest.php index 93626c71..db03a478 100644 --- a/tests/ParsingBugsTest.php +++ b/tests/ParsingBugsTest.php @@ -1,22 +1,22 @@ assertEquals($u->scalarval(), $v->scalarval()); } - function testUnicodeInMemberName(){ - $str = "G".chr(252)."nter, El".chr(232)."ne"; + public function testUnicodeInMemberName() + { + $str = "G" . chr(252) . "nter, El" . chr(232) . "ne"; $v = array($str => new xmlrpcval(1)); $r = new xmlrpcresp(new xmlrpcval($v, 'struct')); $r = $r->serialize(); @@ -26,14 +26,14 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase $this->assertEquals($v->structmemexists($str), true); } - function testUnicodeInErrorString() + public function testUnicodeInErrorString() { $response = utf8_encode( ' - + @@ -44,7 +44,7 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase faultString -'.chr(224).chr(252).chr(232).'àüè +' . chr(224) . chr(252) . chr(232) . 'àüè @@ -53,13 +53,13 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase $m = new xmlrpcmsg('dummy'); $r = $m->parseResponse($response); $v = $r->faultString(); - $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v); + $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v); } - function testValidNumbers() + public function testValidNumbers() { $m = new xmlrpcmsg('dummy'); - $fp= + $fp = ' @@ -91,13 +91,13 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase '; - $r=$m->parseResponse($fp); - $v=$r->value(); - $s=$v->structmem('integer1'); - $t=$v->structmem('float1'); - $u=$v->structmem('integer2'); - $w=$v->structmem('float2'); - $x=$v->structmem('float3'); + $r = $m->parseResponse($fp); + $v = $r->value(); + $s = $v->structmem('integer1'); + $t = $v->structmem('float1'); + $u = $v->structmem('integer2'); + $w = $v->structmem('float2'); + $x = $v->structmem('float3'); $this->assertEquals(1, $s->scalarval()); $this->assertEquals(1.1, $t->scalarval()); $this->assertEquals(1, $u->scalarval()); @@ -105,15 +105,15 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase $this->assertEquals(-110.0, $x->scalarval()); } - function testAddScalarToStruct() + public function testAddScalarToStruct() { $v = new xmlrpcval(array('a' => 'b'), 'struct'); // use @ operator in case error_log gets on screen - $r = @$v->addscalar('c'); + $r = @$v->addscalar('c'); $this->assertEquals(0, $r); } - function testAddStructToStruct() + public function testAddStructToStruct() { $v = new xmlrpcval(array('a' => new xmlrpcval('b')), 'struct'); $r = $v->addstruct(array('b' => new xmlrpcval('c'))); @@ -123,7 +123,7 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase $this->assertEquals(2, $v->structsize()); } - function testAddArrayToArray() + public function testAddArrayToArray() { $v = new xmlrpcval(array(new xmlrpcval('a'), new xmlrpcval('b')), 'array'); $r = $v->addarray(array(new xmlrpcval('b'), new xmlrpcval('c'))); @@ -131,20 +131,20 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase $this->assertEquals(1, $r); } - function testEncodeArray() + public function testEncodeArray() { $r = range(1, 100); $v = php_xmlrpc_encode($r); $this->assertEquals('array', $v->kindof()); } - function testEncodeRecursive() + public function testEncodeRecursive() { $v = php_xmlrpc_encode(php_xmlrpc_encode('a simple string')); $this->assertEquals('scalar', $v->kindof()); } - function testBrokenRequests() + public function testBrokenRequests() { $s = new xmlrpc_server(); // omitting the 'params' tag: not tolerated by the lib anymore @@ -179,7 +179,7 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase $this->assertEquals(15, $r->faultCode()); } - function testBrokenResponses() + public function testBrokenResponses() { $m = new xmlrpcmsg('dummy'); //$m->debug = 1; @@ -212,7 +212,7 @@ class ParsingBugsTests extends PHPUnit_Framework_TestCase $this->assertEquals(2, $r->faultCode()); } - function testBuggyHttp() + public function testBuggyHttp() { $s = new xmlrpcmsg('dummy'); $f = 'HTTP/1.1 100 Welcome to the jungle @@ -239,7 +239,7 @@ and there they were.postid7414222assertEquals("hello world. 2 newlines follow\n\n\nand there they were.", $s->scalarval()); } - function testStringBug() + public function testStringBug() { $s = new xmlrpcmsg('dummy'); $f = ' @@ -275,7 +275,7 @@ and there they were.postid7414222assertEquals('S300510007I', $s->scalarval()); } - function testWhiteSpace() + public function testWhiteSpace() { $s = new xmlrpcmsg('dummy'); $f = 'userid311127 @@ -290,7 +290,7 @@ and there they were.postid7414222assertEquals("hello world. 2 newlines follow\n\n\nand there they were.", $s->scalarval()); } - function testDoubleDataInArrayTag() + public function testDoubleDataInArrayTag() { $s = new xmlrpcmsg('dummy'); $f = ' @@ -311,7 +311,7 @@ and there they were.postid7414222assertEquals(2, $v); } - function testDoubleStuffInValueTag() + public function testDoubleStuffInValueTag() { $s = new xmlrpcmsg('dummy'); $f = ' @@ -340,7 +340,7 @@ and there they were.postid7414222assertEquals(2, $v); } - function testAutodecodeResponse() + public function testAutodecodeResponse() { $s = new xmlrpcmsg('dummy'); $f = 'userid311127 @@ -355,7 +355,7 @@ and there they were.postid7414222assertEquals("hello world. 2 newlines follow\n\n\nand there they were.", $s); } - function testNoDecodeResponse() + public function testNoDecodeResponse() { $s = new xmlrpcmsg('dummy'); $f = 'userid311127 @@ -368,7 +368,7 @@ and there they were.postid7414222assertEquals($f, $v); } - function testAutoCoDec() + public function testAutoCoDec() { $data1 = array(1, 1.0, 'hello world', true, '20051021T23:43:00', -1, 11.0, '~!@#$%^&*()_+|', false, '20051021T23:43:00'); $data2 = array('zero' => $data1, 'one' => $data1, 'two' => $data1, 'three' => $data1, 'four' => $data1, 'five' => $data1, 'six' => $data1, 'seven' => $data1, 'eight' => $data1, 'nine' => $data1); @@ -387,9 +387,9 @@ and there they were.postid7414222assertEquals($m1, $m2); } - function testUTF8Request() + public function testUTF8Request() { - $sendstring='κόσμε'; // Greek word 'kosme'. NB: NOT a valid ISO8859 string! + $sendstring = 'κόσμε'; // Greek word 'kosme'. NB: NOT a valid ISO8859 string! $GLOBALS['xmlrpc_internalencoding'] = 'UTF-8'; \PhpXmlRpc\PhpXmlRpc::importGlobals(); $f = new xmlrpcval($sendstring, 'string'); @@ -399,18 +399,18 @@ and there they were.postid7414222userid311127 -dateCreated20011126T09:17:52content'.utf8_encode('àüèàüè').'postid7414222 + $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n" . 'userid311127 +dateCreated20011126T09:17:52content' . utf8_encode('àüèàüè') . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals'); $v = $r->value(); $v = $v['content']; $this->assertEquals("àüèàüè", $v); $f = 'userid311127 -dateCreated20011126T09:17:52content'.utf8_encode('àüèàüè').'postid7414222 +dateCreated20011126T09:17:52content' . utf8_encode('àüèàüè') . 'postid7414222 '; $r = $s->parseResponse($f, false, 'phpvals'); $v = $r->value(); @@ -418,21 +418,21 @@ and there they were.postid7414222assertEquals("àüèàüè", $v); } - function testUTF8IntString() + public function testUTF8IntString() { $v = new xmlrpcval(100, 'int'); $s = $v->serialize('UTF-8'); $this->assertequals("100\n", $s); } - function testStringInt() + public function testStringInt() { $v = new xmlrpcval('hello world', 'int'); $s = $v->serialize(); $this->assertequals("0\n", $s); } - function testStructMemExists() + public function testStructMemExists() { $v = php_xmlrpc_encode(array('hello' => 'world')); $b = $v->structmemexists('hello'); @@ -441,7 +441,7 @@ and there they were.postid7414222assertequals(false, $b); } - function testNilvalue() + public function testNilvalue() { // default case: we do not accept nil values received $v = new xmlrpcval('hello', 'null'); @@ -462,7 +462,7 @@ and there they were.postid7414222serialize(); - $this->assertequals(1, preg_match( '##', $s )); + $this->assertequals(1, preg_match('##', $s)); // deserialization $r = new xmlrpcresp($v); $s = $r->serialize(); @@ -475,27 +475,21 @@ and there they were.postid7414222assertequals(2, $r->faultCode()); } - function TestLocale() + public function TestLocale() { $locale = setlocale(LC_NUMERIC, 0); /// @todo on php 5.3/win setting locale to german does not seem to set decimal separator to comma... - if (setlocale(LC_NUMERIC,'deu', 'de_DE@euro', 'de_DE', 'de', 'ge') !== false) - { + if (setlocale(LC_NUMERIC, 'deu', 'de_DE@euro', 'de_DE', 'de', 'ge') !== false) { $v = new xmlrpcval(1.1, 'double'); - if (strpos($v->scalarval(), ',') == 1) - { + if (strpos($v->scalarval(), ',') == 1) { $r = $v->serialize(); $this->assertequals(false, strpos($r, ',')); setlocale(LC_NUMERIC, $locale); - } - else - { + } else { setlocale(LC_NUMERIC, $locale); $this->markTestSkipped('did not find a locale which sets decimal separator to comma'); } - } - else - { + } else { $this->markTestSkipped('did not find a locale which sets decimal separator to comma'); } } diff --git a/tests/benchmark.php b/tests/benchmark.php index 59a9cb8c..62d6ef6f 100644 --- a/tests/benchmark.php +++ b/tests/benchmark.php @@ -1,6 +1,7 @@ \n\n\n$title\n\n\n

$title

\n
\n";
-}
-else
-{
+} else {
     echo "$title\n\n";
 }
 
-if($is_web)
-{
-    echo "

Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."

\n"; - if ($xd) echo "

XDEBUG profiling enabled: skipping remote tests. Trace file is: ".htmlspecialchars(xdebug_get_profiler_filename())."

\n"; +if ($is_web) { + echo "

Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "

\n"; + if ($xd) { + echo "

XDEBUG profiling enabled: skipping remote tests. Trace file is: " . htmlspecialchars(xdebug_get_profiler_filename()) . "

\n"; + } flush(); ob_flush(); -} -else -{ - echo "Using lib version: ".PhpXmlRpc::$xmlrpcVersion." on PHP version: ".phpversion()."\n"; - if ($xd) echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: ".xdebug_get_profiler_filename()."\n"; +} else { + echo "Using lib version: " . PhpXmlRpc::$xmlrpcVersion . " on PHP version: " . phpversion() . "\n"; + if ($xd) { + echo "XDEBUG profiling enabled: skipping remote tests\nTrace file is: " . xdebug_get_profiler_filename() . "\n"; + } } // test 'old style' data encoding vs. 'automatic style' encoding begin_test('Data encoding (large array)', 'manual encoding'); -for ($i = 0; $i < $num_tests; $i++) -{ +for ($i = 0; $i < $num_tests; $i++) { $vals = array(); - for ($j = 0; $j < 10; $j++) - { + for ($j = 0; $j < 10; $j++) { $valarray = array(); - foreach ($data[$j] as $key => $val) - { + foreach ($data[$j] as $key => $val) { $values = array(); $values[] = new Value($val[0], 'int'); $values[] = new Value($val[1], 'double'); @@ -116,24 +115,21 @@ end_test('Data encoding (large array)', 'manual encoding', $out); begin_test('Data encoding (large array)', 'automatic encoding'); $encoder = new Encoder(); -for ($i = 0; $i < $num_tests; $i++) -{ +for ($i = 0; $i < $num_tests; $i++) { $value = $encoder->encode($data, array('auto_dates')); $out = $value->serialize(); } end_test('Data encoding (large array)', 'automatic encoding', $out); -if (function_exists('xmlrpc_set_type')) -{ +if (function_exists('xmlrpc_set_type')) { begin_test('Data encoding (large array)', 'xmlrpc-epi encoding'); - for ($i = 0; $i < $num_tests; $i++) - { - for ($j = 0; $j < 10; $j++) - foreach ($keys as $k) - { + for ($i = 0; $i < $num_tests; $i++) { + for ($j = 0; $j < 10; $j++) { + foreach ($keys as $k) { xmlrpc_set_type($data[$j][$k][4], 'datetime'); xmlrpc_set_type($data[$j][$k][8], 'datetime'); } + } $out = xmlrpc_encode($data); } end_test('Data encoding (large array)', 'xmlrpc-epi encoding', $out); @@ -142,23 +138,19 @@ if (function_exists('xmlrpc_set_type')) // test 'old style' data decoding vs. 'automatic style' decoding $dummy = new Request(''); $out = new Response($value); -$in = ''."\n".$out->serialize(); +$in = '' . "\n" . $out->serialize(); begin_test('Data decoding (large array)', 'manual decoding'); -for ($i = 0; $i < $num_tests; $i++) -{ +for ($i = 0; $i < $num_tests; $i++) { $response = $dummy->ParseResponse($in, true); $value = $response->value(); $result = array(); - for ($k = 0; $k < $value->arraysize(); $k++) - { + for ($k = 0; $k < $value->arraysize(); $k++) { $val1 = $value->arraymem($k); $out = array(); - while (list($name, $val) = $val1->structeach()) - { + while (list($name, $val) = $val1->structeach()) { $out[$name] = array(); - for ($j = 0; $j < $val->arraysize(); $j++) - { + for ($j = 0; $j < $val->arraysize(); $j++) { $data = $val->arraymem($j); $out[$name][] = $data->scalarval(); } @@ -169,42 +161,36 @@ for ($i = 0; $i < $num_tests; $i++) end_test('Data decoding (large array)', 'manual decoding', $result); begin_test('Data decoding (large array)', 'automatic decoding'); -for ($i = 0; $i < $num_tests; $i++) -{ +for ($i = 0; $i < $num_tests; $i++) { $response = $dummy->ParseResponse($in, true, 'phpvals'); $value = $response->value(); } end_test('Data decoding (large array)', 'automatic decoding', $value); -if (function_exists('xmlrpc_decode')) -{ +if (function_exists('xmlrpc_decode')) { begin_test('Data decoding (large array)', 'xmlrpc-epi decoding'); - for ($i = 0; $i < $num_tests; $i++) - { + for ($i = 0; $i < $num_tests; $i++) { $response = $dummy->ParseResponse($in, true, 'xml'); $value = xmlrpc_decode($response->value()); } end_test('Data decoding (large array)', 'xmlrpc-epi decoding', $value); } -if (!$xd) -{ +if (!$xd) { /// test multicall vs. many calls vs. keep-alives $encoder = new Encoder(); $value = $encoder->encode($data1, array('auto_dates')); $req = new Request('interopEchoTests.echoValue', array($value)); $reqs = array(); - for ($i = 0; $i < 25; $i++) + for ($i = 0; $i < 25; $i++) { $reqs[] = $req; + } $server = explode(':', $args['LOCALSERVER']); - if(count($server) > 1) - { + if (count($server) > 1) { $srv = $server[1] . '://' . $server[0] . $args['URI']; $c = new Client($args['URI'], $server[0], $server[1]); - } - else - { + } else { $srv = $args['LOCALSERVER'] . $args['URI']; $c = new Client($args['URI'], $args['LOCALSERVER']); } @@ -219,19 +205,16 @@ if (!$xd) } begin_test($testName, 'http 10'); $response = array(); - for ($i = 0; $i < 25; $i++) - { + for ($i = 0; $i < 25; $i++) { $resp = $c->send($req); $response[] = $resp->value(); } end_test($testName, 'http 10', $response); - if (function_exists('curl_init')) - { + if (function_exists('curl_init')) { begin_test($testName, 'http 11 w. keep-alive'); $response = array(); - for ($i = 0; $i < 25; $i++) - { + for ($i = 0; $i < 25; $i++) { $resp = $c->send($req, 10, 'http11'); $response[] = $resp->value(); } @@ -240,8 +223,7 @@ if (!$xd) $c->keepalive = false; begin_test($testName, 'http 11'); $response = array(); - for ($i = 0; $i < 25; $i++) - { + for ($i = 0; $i < 25; $i++) { $resp = $c->send($req, 10, 'http11'); $response[] = $resp->value(); } @@ -250,32 +232,27 @@ if (!$xd) begin_test($testName, 'multicall'); $response = $c->send($reqs); - foreach ($response as $key =>& $val) - { + foreach ($response as $key => & $val) { $val = $val->value(); } end_test($testName, 'multicall', $response); - if (function_exists('gzinflate')) - { + if (function_exists('gzinflate')) { $c->accepted_compression = array('gzip'); $c->request_compression = 'gzip'; begin_test($testName, 'http 10 w. compression'); $response = array(); - for ($i = 0; $i < 25; $i++) - { + for ($i = 0; $i < 25; $i++) { $resp = $c->send($req); $response[] = $resp->value(); } end_test($testName, 'http 10 w. compression', $response); - if (function_exists('curl_init')) - { + if (function_exists('curl_init')) { begin_test($testName, 'http 11 w. keep-alive and compression'); $response = array(); - for ($i = 0; $i < 25; $i++) - { + for ($i = 0; $i < 25; $i++) { $resp = $c->send($req, 10, 'http11'); $response[] = $resp->value(); } @@ -284,8 +261,7 @@ if (!$xd) $c->keepalive = false; begin_test($testName, 'http 11 w. compression'); $response = array(); - for ($i = 0; $i < 25; $i++) - { + for ($i = 0; $i < 25; $i++) { $resp = $c->send($req, 10, 'http11'); $response[] = $resp->value(); } @@ -294,26 +270,22 @@ if (!$xd) begin_test($testName, 'multicall w. compression'); $response = $c->send($reqs); - foreach ($response as $key =>& $val) - { + foreach ($response as $key => & $val) { $val = $val->value(); } end_test($testName, 'multicall w. compression', $response); } - } // end of 'if no xdebug profiling' echo "\n"; -foreach($test_results as $test => $results) -{ +foreach ($test_results as $test => $results) { echo "\nTEST: $test\n"; - foreach ($results as $case => $data) - echo " $case: {$data['time']} secs - Output data CRC: ".crc32(serialize($data['result']))."\n"; + foreach ($results as $case => $data) { + echo " $case: {$data['time']} secs - Output data CRC: " . crc32(serialize($data['result'])) . "\n"; + } } - -if($is_web) -{ +if ($is_web) { echo "\n
\n\n\n"; } diff --git a/tests/parse_args.php b/tests/parse_args.php index 18b6bc37..4397e640 100644 --- a/tests/parse_args.php +++ b/tests/parse_args.php @@ -1,6 +1,7 @@ false, 'PROXYSERVER' => null, 'NOPROXY' => false, - 'LOCALPATH' => __DIR__ + 'LOCALPATH' => __DIR__, ); // check for command line vs web page input params - if(!isset($_SERVER['REQUEST_METHOD'])) - { - if(isset($argv)) - { - foreach($argv as $param) - { + if (!isset($_SERVER['REQUEST_METHOD'])) { + if (isset($argv)) { + foreach ($argv as $param) { $param = explode('=', $param); - if(count($param) > 1) - { + if (count($param) > 1) { $pname = strtoupper(ltrim($param[0], '-')); - $$pname=$param[1]; + $$pname = $param[1]; } } } - } - else - { + } else { // NB: we might as well consider using $_GET stuff later on... extract($_GET); extract($_POST); } - if(isset($DEBUG)) - { + if (isset($DEBUG)) { $args['DEBUG'] = intval($DEBUG); } - if(isset($LOCALSERVER)) - { + if (isset($LOCALSERVER)) { $args['LOCALSERVER'] = $LOCALSERVER; - } - else - { - if(isset($HTTP_HOST)) - { + } else { + if (isset($HTTP_HOST)) { $args['LOCALSERVER'] = $HTTP_HOST; - } - elseif(isset($_SERVER['HTTP_HOST'])) - { + } elseif (isset($_SERVER['HTTP_HOST'])) { $args['LOCALSERVER'] = $_SERVER['HTTP_HOST']; } } - if(isset($HTTPSSERVER)) - { + if (isset($HTTPSSERVER)) { $args['HTTPSSERVER'] = $HTTPSSERVER; } - if(isset($HTTPSURI)) - { + if (isset($HTTPSURI)) { $args['HTTPSURI'] = $HTTPSURI; } - if(isset($HTTPSIGNOREPEER)) - { + if (isset($HTTPSIGNOREPEER)) { $args['HTTPSIGNOREPEER'] = bool($HTTPSIGNOREPEER); } - if(isset($PROXY)) - { + if (isset($PROXY)) { $arr = explode(':', $PROXY); $args['PROXYSERVER'] = $arr[0]; - if(count($arr) > 1) - { + if (count($arr) > 1) { $args['PROXYPORT'] = $arr[1]; - } - else - { + } else { $args['PROXYPORT'] = 8080; } } // used to silence testsuite warnings about proxy code not being tested - if(isset($NOPROXY)) - { + if (isset($NOPROXY)) { $args['NOPROXY'] = true; } - if(!isset($URI)) - { + if (!isset($URI)) { // GUESTIMATE the url of local demo server // play nice to php 3 and 4-5 in retrieving URL of server.php /// @todo filter out query string from REQUEST_URI - if(isset($REQUEST_URI)) - { + if (isset($REQUEST_URI)) { $URI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $REQUEST_URI); $URI = str_replace('/testsuite.php', '/server.php', $URI); $URI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $URI); $URI = str_replace('/benchmark.php', '/server.php', $URI); - } - elseif(isset($_SERVER['PHP_SELF']) && isset($_SERVER['REQUEST_METHOD'])) - { + } elseif (isset($_SERVER['PHP_SELF']) && isset($_SERVER['REQUEST_METHOD'])) { $URI = str_replace('/tests/testsuite.php', '/demo/server/server.php', $_SERVER['PHP_SELF']); $URI = str_replace('/testsuite.php', '/server.php', $URI); $URI = str_replace('/tests/benchmark.php', '/demo/server/server.php', $URI); $URI = str_replace('/benchmark.php', '/server.php', $URI); - } - else - { + } else { $URI = '/demo/server/server.php'; } } - if($URI[0] != '/') - { - $URI = '/'.$URI; + if ($URI[0] != '/') { + $URI = '/' . $URI; } $args['URI'] = $URI; - if(isset($LOCALPATH)) - { - $args['LOCALPATH'] =$LOCALPATH; + if (isset($LOCALPATH)) { + $args['LOCALPATH'] = $LOCALPATH; } return $args; } - -} \ No newline at end of file +} diff --git a/tests/verify_compat.php b/tests/verify_compat.php index c9c4ad24..85dee628 100644 --- a/tests/verify_compat.php +++ b/tests/verify_compat.php @@ -1,6 +1,6 @@ -PHP XMLRPC compatibility assessment - + PHP XMLRPC compatibility assessment +

PHPXMLRPC compatibility assessment with the current PHP install

For phpxmlrpc version 4.0 or later

+

Server usage

- - - - - $result) - { - echo '\n"; - } -?> - + + + + + + + + $result) { + echo '\n"; + } + ?> +
TestResult
'.htmlspecialchars($test).''.htmlspecialchars($result['description'])."
TestResult
' . htmlspecialchars($test) . '' . htmlspecialchars($result['description']) . "

Client usage

- - - - - $result) - { - echo '\n"; - } -?> - + + + + + + + + $result) { + echo '\n"; + } + ?> +
TestResult
'.htmlspecialchars($test).''.htmlspecialchars($result['description'])."
TestResult
' . htmlspecialchars($test) . '' . htmlspecialchars($result['description']) . "
- \ No newline at end of file +