From: gggeek Date: Tue, 23 Apr 2024 10:11:10 +0000 (+0000) Subject: add tests for recent parsing changes X-Git-Tag: 4.10.3~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a67513ae7f1df3f9b648a190af4780ec660d4061;p=plcapi.git add tests for recent parsing changes --- diff --git a/tests/04ParsingTest.php b/tests/04ParsingTest.php index 1911c9d2..345d40f2 100644 --- a/tests/04ParsingTest.php +++ b/tests/04ParsingTest.php @@ -218,6 +218,17 @@ class ParsingTest extends PhpXmlRpc_LoggerAwareTestCase public function testBrokenRequests() { $s = new xmlrpc_server(); + + // omitting the 'methodName' tag: not tolerated by the lib anymore + $f = ' + + +system.methodHelp + +'; + $r = $s->parserequest($f); + $this->assertEquals(15, $r->faultCode()); + // omitting the 'params' tag: not tolerated by the lib anymore $f = ' @@ -228,6 +239,7 @@ class ParsingTest extends PhpXmlRpc_LoggerAwareTestCase '; $r = $s->parserequest($f); $this->assertEquals(15, $r->faultCode()); + // omitting a 'param' tag $f = ' @@ -238,6 +250,7 @@ class ParsingTest extends PhpXmlRpc_LoggerAwareTestCase '; $r = $s->parserequest($f); $this->assertEquals(15, $r->faultCode()); + // omitting a 'value' tag $f = ' @@ -253,24 +266,39 @@ class ParsingTest extends PhpXmlRpc_LoggerAwareTestCase public function testBrokenResponses() { $m = $this->newRequest('dummy'); + // omitting the 'params' tag: no more tolerated by the lib... $f = ' +'; + $r = $m->parseResponse($f); + $this->assertEquals(2, $r->faultCode()); + $f = ' + system.methodHelp '; $r = $m->parseResponse($f); $this->assertEquals(2, $r->faultCode()); + // omitting the 'param' tag: no more tolerated by the lib... $f = ' + +'; + $r = $m->parseResponse($f); + $this->assertEquals(2, $r->faultCode()); + $f = ' + + system.methodHelp '; $r = $m->parseResponse($f); $this->assertEquals(2, $r->faultCode()); + // omitting a 'value' tag: KO $f = '