本文整理汇总了PHP中Facebook\FacebookRequest::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP FacebookRequest::getParams方法的具体用法?PHP FacebookRequest::getParams怎么用?PHP FacebookRequest::getParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Facebook\FacebookRequest
的用法示例。
在下文中一共展示了FacebookRequest::getParams方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAVideoCanBeAddedToParams
public function testAVideoCanBeAddedToParams()
{
$myFile = new FacebookVideo(__DIR__ . '/foo.txt');
$params = ['name' => 'Foo Bar', 'source' => $myFile];
$app = new FacebookApp('123', 'foo_secret');
$request = new FacebookRequest($app, 'foo_token', 'POST', '/foo/videos', $params);
$actualParams = $request->getParams();
$this->assertTrue($request->containsFileUploads());
$this->assertTrue($request->containsVideoUploads());
$this->assertTrue(!isset($actualParams['source']));
$this->assertEquals('Foo Bar', $actualParams['name']);
}
示例2: sendRequest
public function sendRequest(FacebookRequest $request)
{
$params = $request->getParams();
$rawResponse = json_encode(['access_token' => 'foo_access_token_from:' . $params['code']]);
return new FacebookResponse($request, $rawResponse, 200);
}