You are here

public function PMPAPIWebTestCase::setUp in Public Media Platform API Integration 7

Sets up the test environment.

Overrides DrupalWebTestCase::setUp

See also

DrupalWebTestCase::setUp()

File

tests/pmpapi.test, line 26

Class

PMPAPIWebTestCase
Tests the functionality of the PMPAPI module.

Code

public function setUp() {
  parent::setUp(array(
    'pmpapi',
  ));

  // Create and log in our privileged user.
  $this->privileged_user = $this
    ->drupalCreateUser(array(
    'administer PMP API',
  ));
  $this
    ->drupalLogin($this->privileged_user);

  // Set up client_id, client_secret, host
  // @TODO: Throw this into a separate test -- using GUI?
  module_load_include('php', 'pmpapi', 'tests/settings');
  $vars = pmpapi_test_get_secret_vars();
  variable_set('pmpapi_auth_client_id', $vars['client_id']);
  variable_set('pmpapi_auth_client_secret', $vars['client_secret']);
  variable_set('pmpapi_base_url', $vars['host']);

  // Turn off caching
  variable_set('pmpapi_cache', FALSE);
}