Esempio n. 1
0
 /**
  * Step 2
  * Once you have the code, paste it on code.php and execute this one.
  *
  * Again, it will retrieve the valid token.
  * Copy and paste on test/everything_else/long_access_token.php
  *
  * Now you can execute all the tests inside the everything_else folder
  */
 public function testAuthentication()
 {
     $code = (include __DIR__ . '/code.php');
     $this->core->authenticate($code);
     echo 'Here is your token: ' . serialize(array('access_token' => $this->access_token_data->getLongAccessToken(), 'expires' => 5000));
     $this->assertTrue($this->core->isLogged());
 }
Esempio n. 2
0
 /**
  * Get the data for $key, persisted by BaseFacebook::setPersistentData()
  *
  * @param string  $key     The key of the data to retrieve
  * @param boolean $default The default value to return if $key is not found
  *
  * @return mixed
  */
 protected function getPersistentData($key, $default = false)
 {
     switch ($key) {
         case 'access_token':
             $value = $this->access_token_data->getLongAccessToken();
             break;
         default:
             $value = $default;
             break;
     }
     return $value;
 }