Example #1
0
 /**
  * saveXML() test
  */
 public function testSaveXML()
 {
     $this->_fault->setCode(1000);
     $this->_fault->setMessage('Fault message');
     $xml = $this->_fault->saveXML();
     $this->_testXmlFault($xml);
 }
Example #2
0
 public function testGettingAllMethodSignaturesDegradesToLooping()
 {
     // system.listMethods() will return ['foo', 'bar']
     $whatListMethodsReturns = array('foo', 'bar');
     $response = $this->getServerResponseFor($whatListMethodsReturns);
     $this->httpAdapter->setResponse($response);
     // system.multicall() will return a fault
     $fault = new Zend_XmlRpc_Fault(7, 'bad method');
     $xml = $fault->saveXML();
     $response = $this->makeHttpResponseFrom($xml);
     $this->httpAdapter->addResponse($response);
     // system.methodSignature('foo') will return [['int'], ['int', 'string']]
     $fooSignatures = array(array('int'), array('int', 'string'));
     $response = $this->getServerResponseFor($fooSignatures);
     $this->httpAdapter->addResponse($response);
     // system.methodSignature('bar') will return [['boolean']]
     $barSignatures = array(array('boolean'));
     $response = $this->getServerResponseFor($barSignatures);
     $this->httpAdapter->addResponse($response);
     $i = $this->xmlrpcClient->getIntrospector();
     $expected = array('foo' => $fooSignatures, 'bar' => $barSignatures);
     $this->assertEquals($expected, $i->getSignatureForEachMethod());
     $request = $this->xmlrpcClient->getLastRequest();
     $this->assertEquals('system.methodSignature', $request->getMethod());
 }