當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。