本文整理汇总了PHP中Facebook\FacebookRequest::appendParamsToUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP FacebookRequest::appendParamsToUrl方法的具体用法?PHP FacebookRequest::appendParamsToUrl怎么用?PHP FacebookRequest::appendParamsToUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook\FacebookRequest
的用法示例。
在下文中一共展示了FacebookRequest::appendParamsToUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGracefullyHandlesUrlAppending
public function testGracefullyHandlesUrlAppending()
{
$params = array();
$url = 'https://www.foo.com/';
$processed_url = FacebookRequest::appendParamsToUrl($url, $params);
$this->assertEquals('https://www.foo.com/', $processed_url);
$params = array('access_token' => 'foo');
$url = 'https://www.foo.com/';
$processed_url = FacebookRequest::appendParamsToUrl($url, $params);
$this->assertEquals('https://www.foo.com/?access_token=foo', $processed_url);
$params = array('access_token' => 'foo', 'bar' => 'baz');
$url = 'https://www.foo.com/?foo=bar';
$processed_url = FacebookRequest::appendParamsToUrl($url, $params);
$this->assertEquals('https://www.foo.com/?access_token=foo&bar=baz&foo=bar', $processed_url);
$params = array('access_token' => 'foo');
$url = 'https://www.foo.com/?foo=bar&access_token=bar';
$processed_url = FacebookRequest::appendParamsToUrl($url, $params);
$this->assertEquals('https://www.foo.com/?access_token=bar&foo=bar', $processed_url);
}