function FbconnectTestCase::_createFbTestUser in Facebook Connect 7.2
Same name and namespace in other branches
- 8.2 tests/fbconnect.test \FbconnectTestCase::_createFbTestUser()
4 calls to FbconnectTestCase::_createFbTestUser()
File
- tests/
fbconnect.test, line 28 - Defines FBConnect Test Case.
Class
- FbconnectTestCase
- @file Defines FBConnect Test Case.
Code
function _createFbTestUser($installed = 'true', $permissions = '') {
$facebook_config = fbconnect_get_config();
unset($_SESSION['fbconnect_token']);
unset($_COOKIE['fbconnect_token_' . $facebook_config['app_id']]);
setcookie('fbconnect_token_' . $facebook_config['app_id'], '');
$url = "/{$facebook_config['app_id']}/accounts/test-users?installed={$installed}&permissions={$permissions}";
$fb_user = fbconnect_graph_query($url, array(), 'POST', TRUE);
if (!empty($fb_user)) {
$fb_user = $fb_user
->asArray();
$this->_fb_users[] = $fb_user;
}
$this
->verbose('_createFbTestUser: fb_user=' . var_export($fb_user, TRUE));
$this
->assertTrue(isset($fb_user['id']), 'created test FB user', 'FBConnect');
return $fb_user;
}