X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=test%2Ftestsuite.php;h=696138b9bd9d4a0c3c6881c6cddae04ff23b4df0;hb=1ee5faa414db41b8ca8d4684646e772593103727;hp=3b33f8083987aeb96a1767332821f2e7b83faa9f;hpb=9107200d73d380c154d92ebb9d5452f3a3c8169d;p=plcapi.git diff --git a/test/testsuite.php b/test/testsuite.php index 3b33f80..696138b 100644 --- a/test/testsuite.php +++ b/test/testsuite.php @@ -534,7 +534,8 @@ And turned it into nylon'; function testAutoRegisteredMethod() { - $func=wrap_xmlrpc_method($this->client, 'examples.getStateName'); + // 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 == '') { $this->fail('Registration of examples.getStateName failed'); @@ -542,6 +543,11 @@ And turned it into nylon'; else { $v=$func(23); + // work around bug in current version of phpunit + if(is_object($v)) + { + $v = var_export($v, true); + } $this->assertEquals('Michigan', $v); } } @@ -567,8 +573,15 @@ And turned it into nylon'; $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'))) unset($rcookies[$c]); + // Seems like we get this when using php-fpm and php 5.5+ ... + if (isset($rcookies[$c]['Max-Age'])) + { + unset($rcookies[$c]['Max-Age']); + } + } 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'... @@ -638,7 +651,9 @@ class LocalHostMultiTests extends LocalhostTests if(strpos($meth, 'test') === 0 && $meth != 'testHttps' && $meth != 'testCatchExceptions') { if (!isset($failed_tests[$meth])) + { $this->$meth(); + } } if ($this->_failed) { @@ -766,7 +781,7 @@ class LocalHostMultiTests extends LocalhostTests function testHttps() { - global $HTTPSSERVER, $HTTPSURI, $HTTPSIGNOREPEER; + global $HTTPSSERVER, $HTTPSURI, $HTTPSIGNOREPEER, $HTTPSVERIFYHOST, $SSLVERSION; if(!function_exists('curl_init')) { $this->fail('CURL missing: cannot test https functionality'); @@ -776,13 +791,15 @@ class LocalHostMultiTests extends LocalhostTests $this->method = 'https'; $this->client->method = 'https'; $this->client->path = $HTTPSURI; - $this->client->setSSLVerifyPeer( !$HTTPSIGNOREPEER ); + $this->client->setSSLVerifyPeer(!$HTTPSIGNOREPEER); + $this->client->setSSLVerifyHost($HTTPSVERIFYHOST); + $this->client->setSSLVersion($SSLVERSION); $this->_runtests(); } function testHttpsProxy() { - global $HTTPSSERVER, $HTTPSURI, $PROXYSERVER, $PROXYPORT, $NOPROXY; + global $HTTPSSERVER, $HTTPSURI, $HTTPSIGNOREPEER, $HTTPSVERIFYHOST, $SSLVERSION, $PROXYSERVER, $PROXYPORT, $NOPROXY; if(!function_exists('curl_init')) { $this->fail('CURL missing: cannot test https functionality'); @@ -799,6 +816,9 @@ class LocalHostMultiTests extends LocalhostTests $this->client->method = 'https'; $this->client->setProxy($PROXYSERVER, $PROXYPORT); $this->client->path = $HTTPSURI; + $this->client->setSSLVerifyPeer(!$HTTPSIGNOREPEER); + $this->client->setSSLVerifyHost($HTTPSVERIFYHOST); + $this->client->setSSLVersion($SSLVERSION); $this->_runtests(); } @@ -856,9 +876,9 @@ class ParsingBugsTests extends PHPUnit_TestCase $response = utf8_encode( ' - - + @@ -869,7 +889,7 @@ class ParsingBugsTests extends PHPUnit_TestCase faultString -���àüè +' . chr(224) . chr(252) . chr(232) . 'àüè @@ -878,7 +898,7 @@ class ParsingBugsTests extends PHPUnit_TestCase $m=new xmlrpcmsg('dummy'); $r=$m->parseResponse($response); $v=$r->faultString(); - $this->assertEquals('���àüè', $v); + $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v); } function testValidNumbers() @@ -1530,6 +1550,10 @@ Proxy Server: \n\n"; + echo $result->toHTML()."\n\n\n"; +} +else +{ + exit($result->failureCount()); } ?> \ No newline at end of file