本文整理汇总了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]);
}
示例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}));
}
示例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());
}
示例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));
}