Provides testing for projects integrated with Facebook API.
Relies on Facebook's tool Test User API.
modules:
enabled:
- Facebook:
depends: PhpBrowser
app_id: 412345678901234
secret: ccb79c1b0fdff54e4f7c928bf233aea5
test_user:
name: FacebookGuy
locale: uk_UA
permissions: [email, publish_stream]
<?php
$I = new ApiGuy($scenario);
$I->am('Guest');
$I->wantToTest('check-in to a place be published on the Facebook using API');
$I->haveFacebookTestUserAccount();
$accessToken = $I->grabFacebookTestUserAccessToken();
$I->haveHttpHeader('Auth', 'FacebookToken ' . $accessToken);
$I->amGoingTo('send request to the backend, so that it will publish on user\'s wall on Facebook');
$I->sendPOST('/api/v1/some-api-endpoint');
$I->seePostOnFacebookWithAttachedPlace('167724369950862');
<?php
$I = new WebGuy($scenario);
$I->am('Guest');
$I->wantToTest('log in to site using Facebook');
$I->haveFacebookTestUserAccount(); // create facebook test user
$I->haveTestUserLoggedInOnFacebook(); // so that facebook will not ask us for login and password
$fbUserFirstName = $I->grabFacebookTestUserFirstName();
$I->amOnPage('/welcome');
$I->see('Welcome, Guest');
$I->click('Login with Facebook');
$I->see('Welcome, ' . $fbUserFirstName);
@since 1.6.3
@author tiger.seo@gmail.com
Returns the test user access token.
return
stringReturns the test user email.
return
stringReturns the test user id.
return
stringReturns URL for test user auto-login.
return
stringReturns the test user name.
return
stringnot documented
Get facebook test user be created.
Please, note that the test user is created only at first invoke, unless $renew arguments is true.
param bool
$renew true if the test user should be recreatedGet facebook test user be logged in on facebook.
This is done by going to facebook.com
@throws ModuleConfigException
Please, note that you must have publish_actions permission to be able to publish to user's feed.
param array
$paramsPlease, note that you must have publish_actions permission to be able to publish to user's feed.
param string
$placeId Place identifier to be verified against user published postsPlease, note that you must have publish_actions permission to be able to publish to user's feed.
param string
$message published post to be verified against the actual post on facebook