Ejemplo n.º 1
0
 public function testGraphAPIWithSession()
 {
     $facebook = new Facebook(array('appId' => self::APP_ID, 'secret' => self::SECRET));
     $facebook->setSession(self::$VALID_EXPIRED_SESSION);
     try {
         $response = $facebook->api('/me');
         $this->fail('Should not get here.');
     } catch (FacebookApiException $e) {
         // means the server got the access token
         $msg = 'OAuthException: Error processing access token.';
         $this->assertEquals((string) $e, $msg, 'Expect the invalid session message.');
         // also ensure the session was reset since it was invalid
         $this->assertEquals($facebook->getSession(), null, 'Expect the to be reset.');
     }
 }
Ejemplo n.º 2
0
	/**
	 * Kills the current Facebook session
	 */
	public function doLogoutFbUser()
	{
		// set the current session to null
		$this->facebook->setSession(null);
	}