示例#1
0
 /**
  * __toString() test
  *
  * Call as method call 
  *
  * Returns: string 
  */
 public function test__toString()
 {
     $this->_response->setReturnValue('return value');
     $xml = $this->_response->__toString();
     try {
         $sx = new SimpleXMLElement($xml);
     } catch (Exception $e) {
         $this->fail('Invalid XML returned');
     }
     $this->assertTrue($sx->params ? true : false);
     $this->assertTrue($sx->params->param ? true : false);
     $this->assertTrue($sx->params->param->value ? true : false);
     $this->assertTrue($sx->params->param->value->string ? true : false);
     $this->assertEquals('return value', (string) $sx->params->param->value->string);
 }
示例#2
0
 /**
  * __toString() test
  */
 public function test__toString()
 {
     $this->_response->setReturnValue('return value');
     $xml = $this->_response->__toString();
     $this->_testXmlResponse($xml);
 }
 public function getServerResponseFor($nativeVars)
 {
     $response = new Zend_XmlRpc_Response();
     $response->setReturnValue($nativeVars);
     $xml = $response->saveXml();
     $response = $this->makeHttpResponseFrom($xml);
     return $response;
 }