You are here

function FbconnectTestCase::testLinking in Facebook Connect 7.2

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

File

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

Class

FbconnectTestCase
@file Defines FBConnect Test Case.

Code

function testLinking() {
  $account = $this
    ->drupalCreateUser();
  $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(
    'name' => $account->name,
    'pass' => $account->pass_raw,
  );
  $this
    ->drupalPost('user', $edit, 'Log in', array(
    'query' => array(
      'destination' => 'fbconnect/authorize',
    ),
  ));
  $this
    ->assertLink('My account', 0, 'User is logged in', 'FBConnect');
}