Skip to content

Commit 6c8ef9d

Browse files
committed
updated docs
1 parent 37304e8 commit 6c8ef9d

1 file changed

Lines changed: 71 additions & 71 deletions

File tree

docs/modules/Facebook.md

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,75 +2,75 @@
22

33
**For additional reference, please review the [source](https://github.com/Codeception/Codeception/tree/2.0/src/Codeception/Module/Facebook.php)**
44

5-
6-
Provides testing for projects integrated with Facebook API.
7-
Relies on Facebook's tool Test User API.
85

9-
<div class="alert alert-info">
10-
To use this module with Composer you need <em>"facebook/php-sdk": "3.*"</em> package.
11-
</div>
6+
Provides testing for projects integrated with Facebook API.
7+
Relies on Facebook's tool Test User API.
128

13-
## Status
9+
<div class="alert alert-info">
10+
To use this module with Composer you need <em>"facebook/php-sdk": "3.*"</em> package.
11+
</div>
1412

15-
* Maintainer: **tiger-seo**
16-
* Stability: **beta**
17-
* Contact: tiger.seo@gmail.com
13+
## Status
1814

19-
## Config
15+
* Maintainer: **tiger-seo**
16+
* Stability: **beta**
17+
* Contact: tiger.seo@gmail.com
2018

21-
* app_id *required* - Facebook application ID
22-
* secret *required* - Facebook application secret
23-
* test_user - Facebook test user parameters:
24-
* name - You can specify a name for the test user you create. The specified name will also be used in the email address assigned to the test user.
25-
* locale - You can specify a locale for the test user you create, the default is en_US. The list of supported locales is available at https://www.facebook.com/translations/FacebookLocales.xml
26-
* permissions - An array of permissions. Your app is granted these permissions for the new test user. The full list of permissions is available at https://developers.facebook.com/docs/authentication/permissions
19+
## Config
2720

28-
### Config example
21+
* app_id *required* - Facebook application ID
22+
* secret *required* - Facebook application secret
23+
* test_user - Facebook test user parameters:
24+
* name - You can specify a name for the test user you create. The specified name will also be used in the email address assigned to the test user.
25+
* locale - You can specify a locale for the test user you create, the default is en_US. The list of supported locales is available at https://www.facebook.com/translations/FacebookLocales.xml
26+
* permissions - An array of permissions. Your app is granted these permissions for the new test user. The full list of permissions is available at https://developers.facebook.com/docs/authentication/permissions
2927

30-
modules:
31-
enabled: [Facebook]
32-
config:
33-
Facebook:
34-
app_id: 412345678901234
35-
secret: ccb79c1b0fdff54e4f7c928bf233aea5
36-
test_user:
37-
name: FacebookGuy
38-
locale: uk_UA
39-
permissions: [email, publish_stream]
28+
### Config example
4029

41-
### Test example:
30+
modules:
31+
enabled: [Facebook]
32+
config:
33+
Facebook:
34+
app_id: 412345678901234
35+
secret: ccb79c1b0fdff54e4f7c928bf233aea5
36+
test_user:
37+
name: FacebookGuy
38+
locale: uk_UA
39+
permissions: [email, publish_stream]
4240

43-
``` php
44-
<?php
45-
$I = new ApiGuy($scenario);
46-
$I->am('Guest');
47-
$I->wantToTest('check-in to a place be published on the Facebook using API');
48-
$I->haveFacebookTestUserAccount();
49-
$accessToken = $I->grabFacebookTestUserAccessToken();
50-
$I->haveHttpHeader('Auth', 'FacebookToken ' . $accessToken);
51-
$I->amGoingTo('send request to the backend, so that it will publish on user\'s wall on Facebook');
52-
$I->sendPOST('/api/v1/some-api-endpoint');
53-
$I->seePostOnFacebookWithAttachedPlace('167724369950862');
41+
### Test example:
5442

55-
```
43+
``` php
44+
<?php
45+
$I = new ApiGuy($scenario);
46+
$I->am('Guest');
47+
$I->wantToTest('check-in to a place be published on the Facebook using API');
48+
$I->haveFacebookTestUserAccount();
49+
$accessToken = $I->grabFacebookTestUserAccessToken();
50+
$I->haveHttpHeader('Auth', 'FacebookToken ' . $accessToken);
51+
$I->amGoingTo('send request to the backend, so that it will publish on user\'s wall on Facebook');
52+
$I->sendPOST('/api/v1/some-api-endpoint');
53+
$I->seePostOnFacebookWithAttachedPlace('167724369950862');
5654

57-
``` php
58-
<?php
59-
$I = new WebGuy($scenario);
60-
$I->am('Guest');
61-
$I->wantToTest('log in to site using Facebook');
62-
$I->haveFacebookTestUserAccount(); // create facebook test user
63-
$I->haveTestUserLoggedInOnFacebook(); // so that facebook will not ask us for login and password
64-
$fbUserFirstName = $I->grabFacebookTestUserFirstName();
65-
$I->amOnPage('/welcome');
66-
$I->see('Welcome, Guest');
67-
$I->click('Login with Facebook');
68-
$I->see('Welcome, ' . $fbUserFirstName);
55+
```
6956

70-
```
57+
``` php
58+
<?php
59+
$I = new WebGuy($scenario);
60+
$I->am('Guest');
61+
$I->wantToTest('log in to site using Facebook');
62+
$I->haveFacebookTestUserAccount(); // create facebook test user
63+
$I->haveTestUserLoggedInOnFacebook(); // so that facebook will not ask us for login and password
64+
$fbUserFirstName = $I->grabFacebookTestUserFirstName();
65+
$I->amOnPage('/welcome');
66+
$I->see('Welcome, Guest');
67+
$I->click('Login with Facebook');
68+
$I->see('Welcome, ' . $fbUserFirstName);
7169

72-
@since 1.6.3
73-
@author tiger.seo@gmail.com
70+
```
71+
72+
@since 1.6.3
73+
@author tiger.seo@gmail.com
7474

7575

7676

@@ -124,56 +124,56 @@ $I->see('Welcome, ' . $fbUserFirstName);
124124

125125
### grabFacebookTestUserAccessToken
126126

127-
Returns the test user access token.
127+
Returns the test user access token.
128128

129-
@return string
129+
@return string
130130

131131

132132
### grabFacebookTestUserEmail
133133

134-
Returns the test user email.
134+
Returns the test user email.
135135

136-
@return string
136+
@return string
137137

138138

139139
### grabFacebookTestUserFirstName
140140

141-
Returns the test user first name.
141+
Returns the test user first name.
142142

143-
@return string
143+
@return string
144144

145145

146146
### grabFacebookTestUserLoginUrl
147147

148-
Returns URL for test user auto-login.
148+
Returns URL for test user auto-login.
149149

150-
@return string
150+
@return string
151151

152152

153153

154154
### haveFacebookTestUserAccount
155155

156-
Get facebook test user be created.
156+
Get facebook test user be created.
157157

158-
*Please, note that the test user is created only at first invoke, unless $renew arguments is true.*
158+
*Please, note that the test user is created only at first invoke, unless $renew arguments is true.*
159159

160-
* `param bool` $renew true if the test user should be recreated
160+
* `param bool` $renew true if the test user should be recreated
161161

162162

163163
### haveTestUserLoggedInOnFacebook
164164

165-
Get facebook test user be logged in on facebook.
165+
Get facebook test user be logged in on facebook.
166166

167-
ModuleConfigException
167+
ModuleConfigException
168168

169169

170170

171171

172172
### seePostOnFacebookWithAttachedPlace
173173

174174

175-
Please, note that you must have publish_stream permission to be able to publish to user's feed.
175+
Please, note that you must have publish_stream permission to be able to publish to user's feed.
176176

177-
* `param string` $placeId Place identifier to be verified against user published posts
177+
* `param string` $placeId Place identifier to be verified against user published posts
178178

179179
<p>&nbsp;</p><div class="alert alert-warning">Module reference is taken from the source code. <a href="https://github.com/Codeception/Codeception/tree/2.0/src/Codeception/Module/Facebook.php">Help us to improve documentation. Edit module reference</a></div>

0 commit comments

Comments
 (0)