Permalink
Browse files

test empty response in code exchange is ignored

  • Loading branch information...
1 parent ad7b8b5 commit d8a53668378640475e2eb4c2e42740e17494583f @daaku daaku committed Jul 10, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/tests.php
View
@@ -1131,6 +1131,23 @@ public function testAPIExceptionDuringCodeExchangeIsIgnored() {
$this->assertFalse($stub->publicGetAccessTokenFromCode('c', ''));
}
+ public function testEmptyResponseInCodeExchangeIsIgnored() {
+ $methods_to_stub = array(
+ '_oauthRequest',
+ );
+ $constructor_args = array(array(
+ 'appId' => self::APP_ID,
+ 'secret' => self::SECRET
+ ));
+ $stub = $this->getMock(
+ 'FBPublicGetAccessTokenFromCode', $methods_to_stub, $constructor_args);
+ $stub
+ ->expects($this->once())
+ ->method('_oauthRequest')
+ ->will($this->returnValue(''));
+ $this->assertFalse($stub->publicGetAccessTokenFromCode('c', ''));
+ }
+
public function testExceptionConstructorWithErrorCode() {
$code = 404;
$e = new FacebookApiException(array('error_code' => $code));

0 comments on commit d8a5366

Please sign in to comment.