+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ // this generates an exception in the function which was wrapped, which is by default wrapped in a known error response
+ $m = new xmlrpcmsg('tests.getStateName.6', array(
+ new xmlrpcval(0, 'int'),
+ ));
+ $v = $this->send($m, $GLOBALS['xmlrpcerr']['server_error']);
+ }
+
+ public function testServerWrappedObjectMethods()
+ {
+ $m = new xmlrpcmsg('tests.getStateName.3', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ $m = new xmlrpcmsg('tests.getStateName.4', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ $m = new xmlrpcmsg('tests.getStateName.5', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ $m = new xmlrpcmsg('tests.getStateName.7', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ $m = new xmlrpcmsg('tests.getStateName.8', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ $m = new xmlrpcmsg('tests.getStateName.9', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+ }
+
+ public function testServerWrappedObjectMethodsAsSource()
+ {
+ $m = new xmlrpcmsg('tests.getStateName.7', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ $m = new xmlrpcmsg('tests.getStateName.8', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+
+ $m = new xmlrpcmsg('tests.getStateName.9', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+ }
+
+ public function testServerClosure()
+ {
+ $m = new xmlrpcmsg('tests.getStateName.10', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+ }
+
+ public function testServerWrappedClosure()
+ {
+ $m = new xmlrpcmsg('tests.getStateName.11', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+ }
+
+ public function testServerWrappedClass()
+ {
+ $m = new xmlrpcmsg('tests.xmlrpcServerMethodsContainer.findState', array(
+ new xmlrpcval(23, 'int'),
+ ));
+ $v = $this->send($m);
+ $this->assertEquals('Michigan', $v->scalarval());
+ }
+
+ public function testWrappedMethod()
+ {
+ // 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' => 0));
+ if ($func == false) {
+ $this->fail('Registration of examples.getStateName failed');