本文整理匯總了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);
}
}