You are here

function FbconnectTestCase::testRegistration in Facebook Connect 7.2

Same name and namespace in other branches
  1. 8.2 tests/fbconnect.test \FbconnectTestCase::testRegistration()
  2. 6.2 tests/fbconnect.test \FbconnectTestCase::testRegistration()

File

tests/fbconnect.test, line 135
Defines FBConnect Test Case.

Class

FbconnectTestCase
@file Defines FBConnect Test Case.

Code

function testRegistration() {
  variable_set('fbconnect_reg_options', 1);
  variable_set('user_register', USER_REGISTER_VISITORS);
  $fb_user = $this
    ->_createFbTestUser('true');
  $edit = array(
    'fbuid' => $fb_user['id'],
    'access_token' => $fb_user['access_token'],
  );
  $this
    ->drupalPost('fbconnect-test/init-fb-session', $edit, 'Submit');
  $this
    ->assertFieldByName('fbuid', $fb_user['id'], 'FB Session inited', 'FBConnect');
  $edit = array(
    'mail' => $this
      ->randomName() . '@example.com',
  );
  $this
    ->drupalPost('fbconnect/authorize', $edit, 'Create new account');
  $this
    ->assertLink('My account', 0, 'User is logged in', 'FBConnect');
}