Example #1
0
 /**
  *	@group CallsExternalResource
  */
 public function testFbInfoFetcherCreatesImageWhenGivenFbSDKInstance()
 {
     $mockedResponse = $this->getMockPictureCallResponse();
     $mockedFbSDK = m::mock('SammyK\\LaravelFacebookSdk\\LaravelFacebookSdk');
     $mockedFbSDK->shouldReceive('get')->with('/me/picture?redirect=false&height=500&width=500')->andReturn($mockedResponse);
     $mockedFbSDK->shouldReceive('getAccessTokenFromRedirect')->andReturn('token');
     $mockedFbSDK->shouldReceive('setDefaultAccessToken');
     $FbPictureFetcherInstance = new FbInfoFetcher($mockedFbSDK);
     $resultingPicture = $FbPictureFetcherInstance->getAuthorizedUsersPicture();
     $this->assertInstanceOf('Intervention\\Image\\Image', $resultingPicture);
 }