File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1148,6 +1148,23 @@ public function testEmptyResponseInCodeExchangeIsIgnored() {
11481148 $ this ->assertFalse ($ stub ->publicGetAccessTokenFromCode ('c ' , '' ));
11491149 }
11501150
1151+ public function testMissingAccessTokenInCodeExchangeIsIgnored () {
1152+ $ methods_to_stub = array (
1153+ '_oauthRequest ' ,
1154+ );
1155+ $ constructor_args = array (array (
1156+ 'appId ' => self ::APP_ID ,
1157+ 'secret ' => self ::SECRET
1158+ ));
1159+ $ stub = $ this ->getMock (
1160+ 'FBPublicGetAccessTokenFromCode ' , $ methods_to_stub , $ constructor_args );
1161+ $ stub
1162+ ->expects ($ this ->once ())
1163+ ->method ('_oauthRequest ' )
1164+ ->will ($ this ->returnValue ('foo=1 ' ));
1165+ $ this ->assertFalse ($ stub ->publicGetAccessTokenFromCode ('c ' , '' ));
1166+ }
1167+
11511168 public function testExceptionConstructorWithErrorCode () {
11521169 $ code = 404 ;
11531170 $ e = new FacebookApiException (array ('error_code ' => $ code ));
You can’t perform that action at this time.
0 commit comments