本文整理汇总了PHP中xmlrpc_client::setCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP xmlrpc_client::setCookie方法的具体用法?PHP xmlrpc_client::setCookie怎么用?PHP xmlrpc_client::setCookie使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmlrpc_client
的用法示例。
在下文中一共展示了xmlrpc_client::setCookie方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetCookies
public function testSetCookies()
{
// let server set to us some cookies we tell it
$cookies = array('c0' => null, 'c1' => 1, 'c2' => '2 3', 'c3' => '!@#$%^&*()_+|}{":?><,./\';[]\\=-');
$m = new xmlrpcmsg('examples.getcookies', array());
foreach ($cookies as $cookie => $val) {
$this->client->setCookie($cookie, $val);
$cookies[$cookie] = (string) $cookies[$cookie];
}
$r = $this->client->send($m, $this->timeout, $this->method);
$this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
if (!$r->faultCode()) {
$v = $r->value();
$v = php_xmlrpc_decode($v);
// take care for the extra cookie used for coverage collection
if (isset($v['PHPUNIT_SELENIUM_TEST_ID'])) {
unset($v['PHPUNIT_SELENIUM_TEST_ID']);
}
// on IIS and Apache getallheaders returns something slightly different...
$this->assertEquals($cookies, $v);
}
}