X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=test%2Ftestsuite.php;h=d2e56d44dcf2a9fa35de6bd386b1d653e67857dd;hb=62545ebd3ce29c40a0be2cacf40be20082944e12;hp=6c43cb95b25f30640cd110b0e3e69f1241b519c9;hpb=8346dc34a350ab95630faac56fca3663a4b8e49b;p=plcapi.git diff --git a/test/testsuite.php b/test/testsuite.php index 6c43cb9..d2e56d4 100644 --- a/test/testsuite.php +++ b/test/testsuite.php @@ -460,6 +460,19 @@ And turned it into nylon'; } } + function testCatchExceptions() + { + global $URI; + $f = new xmlrpcmsg('examples.raiseException', array( + new xmlrpcval('whatever', 'string') + )); + $v = $this->send($f, $GLOBALS['xmlrpcerr']['server_error']); + $this->client->path = $URI.'?EXCEPTION_HANDLING=1'; + $v = $this->send($f, 1); + $this->client->path = $URI.'?EXCEPTION_HANDLING=2'; + $v = $this->send($f, $GLOBALS['xmlrpcerr']['invalid_return']); + } + function testZeroParams() { $f = new xmlrpcmsg('system.listMethods'); @@ -617,7 +630,7 @@ And turned it into nylon'; global $failed_tests; foreach(get_class_methods('LocalhostTests') as $meth) { - if(strpos($meth, 'test') === 0 && $meth != 'testHttps') + if(strpos($meth, 'test') === 0 && $meth != 'testHttps' && $meth != 'testCatchExceptions') { if (!isset($failed_tests[$meth])) $this->$meth(); @@ -1365,6 +1378,7 @@ $f = 'addTest(new LocalhostTests('testClientMulticall2')); $suite->addTest(new LocalhostTests('testClientMulticall3')); $suite->addTest(new LocalhostTests('testCatchWarnings')); + $suite->addTest(new LocalhostTests('testCatchExceptions')); $suite->addTest(new LocalhostTests('testZeroParams')); $suite->addTest(new LocalhostTests('testCodeInjectionServerSide')); $suite->addTest(new LocalhostTests('testAutoRegisteredFunction'));