From a67513ae7f1df3f9b648a190af4780ec660d4061 Mon Sep 17 00:00:00 2001 From: gggeek Date: Tue, 23 Apr 2024 10:11:10 +0000 Subject: [PATCH] add tests for recent parsing changes --- tests/04ParsingTest.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 = ' -- 2.47.0