public function testSessionInfo()
 {
     $params = array('input_token' => FacebookTestHelper::$testSession->getToken());
     $response = (new FacebookRequest(new FacebookSession(FacebookTestHelper::getAppToken()), 'GET', '/debug_token', $params))->execute()->getGraphObject(GraphSessionInfo::className());
     $this->assertTrue($response instanceof GraphSessionInfo);
     $this->assertNotNull($response->getAppId());
     $this->assertTrue($response->isValid());
 }
Exemplo n.º 2
0
 /**
  * Get more info about an access token.
  *
  * @param string|null $appId
  * @param string|null $appSecret
  *
  * @return GraphSessionInfo
  */
 public function getInfo($appId = null, $appSecret = null)
 {
     $params = array('input_token' => $this->accessToken);
     $request = new FacebookRequest(FacebookSession::newAppSession($appId, $appSecret), 'GET', '/debug_token', $params);
     $response = $request->execute()->getGraphObject(GraphSessionInfo::className());
     // Update the data on this token
     if ($response->getExpiresAt()) {
         $this->expiresAt = $response->getExpiresAt();
     }
     return $response;
 }