/** * Send a request to Graph with an app access token. * * @param string $endpoint * @param array $params * @param FacebookApp $app The FacebookApp entity. * @param FacebookClient $client The Facebook client. * * @return FacebookResponse * * @throws FacebookResponseException */ protected static function request($endpoint, array $params, FacebookApp $app, FacebookClient $client) { if (!isset($params['client_id'])) { $params['client_id'] = $app->getId(); } if (!isset($params['client_secret'])) { $params['client_secret'] = $app->getSecret(); } // The response for this endpoint is not JSON, so it must be handled // differently, not as a GraphObject. $request = new FacebookRequest($app, $app->getAccessToken(), 'GET', $endpoint, $params); return $client->sendRequest($request); }
public function testGetId() { $app = new FacebookApp('id', 'secret'); $this->assertEquals('id', $app->getId()); }