当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_XmlRpc_Request::addParam方法代码示例

本文整理汇总了PHP中Zend_XmlRpc_Request::addParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_XmlRpc_Request::addParam方法的具体用法?PHP Zend_XmlRpc_Request::addParam怎么用?PHP Zend_XmlRpc_Request::addParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_XmlRpc_Request的用法示例。


在下文中一共展示了Zend_XmlRpc_Request::addParam方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testAddParam

 /**
  * addParam()/getParams() test
  */
 public function testAddParam()
 {
     $this->_request->addParam('string1');
     $params = $this->_request->getParams();
     $this->assertEquals(1, count($params));
     $this->assertEquals('string1', $params[0]);
     $this->_request->addParam('string2');
     $params = $this->_request->getParams();
     $this->assertEquals(2, count($params));
     $this->assertEquals('string1', $params[0]);
     $this->assertEquals('string2', $params[1]);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:15,代码来源:RequestTest.php

示例2: testAddDateParamGeneratesCorrectXml

 public function testAddDateParamGeneratesCorrectXml()
 {
     $time = time();
     $this->_request->addParam($time, Zend_XmlRpc_Value::XMLRPC_TYPE_DATETIME);
     $this->_request->setMethod('foo.bar');
     $xml = $this->_request->saveXML();
     $sxl = new SimpleXMLElement($xml);
     $param = $sxl->params->param->value;
     $type = 'dateTime.iso8601';
     $this->assertTrue(isset($param->{$type}), var_export($param, 1));
     $this->assertEquals($time, strtotime((string) $param->{$type}));
 }
开发者ID:jon9872,项目名称:zend-framework,代码行数:12,代码来源:RequestTest.php

示例3: testHandleClassStaticMethod

 public function testHandleClassStaticMethod()
 {
     $this->_server->setClass('Zend_XmlRpc_Server_testClass');
     $request = new Zend_XmlRpc_Request();
     $request->setMethod('test2');
     $request->addParam(array('value1', 'value2'));
     $response = $this->_server->handle($request);
     $this->assertFalse($response instanceof Zend_XmlRpc_Fault);
     $this->assertEquals('value1; value2', $response->getReturnValue());
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:10,代码来源:ServerTest.php

示例4: testMulticall

 /**
  * multicall() test
  *
  * Call as method call 
  *
  * Expects:
  * - methods: 
  * 
  * Returns: array 
  */
 public function testMulticall()
 {
     $struct = array(array('methodName' => 'system.listMethods', 'params' => array()), array('methodName' => 'system.methodHelp', 'params' => array('system.multicall')));
     $request = new Zend_XmlRpc_Request();
     $request->setMethod('system.multicall');
     $request->addParam($struct);
     $response = $this->_server->handle($request);
     $this->assertTrue($response instanceof Zend_XmlRpc_Response, $response->__toString());
     $returns = $response->getReturnValue();
     $this->assertTrue(is_array($returns));
     $this->assertEquals(2, count($returns));
     $this->assertTrue(is_array($returns[0]), var_export($returns[0], 1));
     $this->assertTrue(is_string($returns[1]), var_export($returns[1], 1));
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:24,代码来源:ServerTest.php


注:本文中的Zend_XmlRpc_Request::addParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。