You are here

function FbconnectTestCase::setUp in Facebook Connect 8.2

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

Implements setUp().

File

tests/fbconnect.test, line 50

Class

FbconnectTestCase
@file

Code

function setUp() {

  // Change cookie file for user.
  $this->cookieFile = file_stream_wrapper_get_instance_by_scheme('temporary')
    ->getDirectoryPath() . '/cookie.txt';
  $this->additionalCurlOptions[CURLOPT_COOKIEFILE] = $this->cookieFile;
  $this->additionalCurlOptions[CURLOPT_COOKIESESSION] = TRUE;
  $this->settings_keys = array(
    'fbconnect_appid',
    'fbconnect_skey',
  );
  foreach ($this->settings_keys as $key) {
    $this->settings[$key] = variable_get($key, NULL);
  }
  if (!facebook_client()) {
    $this
      ->error('fbconnect is not properly installed. See README.txt');
    return;
  }
  parent::setUp('fbconnect', 'fbconnect_login', 'fbconnect_test');
  foreach ($this->settings as $key => $value) {
    variable_set($key, $value);
  }
}