예제 #1
0
파일: tests.php 프로젝트: rnwldms/php-sdk
 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.');
     }
 }
예제 #2
0
	/**
	 * Kills the current Facebook session
	 */
	public function doLogoutFbUser()
	{
		// set the current session to null
		$this->facebook->setSession(null);
	}