You are here

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

Sets up the test environment.

Overrides DrupalWebTestCase::setUp

See also

DrupalWebTestCase::setUp()

File

pmpapi_permissions/tests/pmpapi_permissions.test, line 29

Class

PMPAPIPermissionsWebTestCase
Tests the functionality of the PMPAPI permissions module.

Code

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

  // Set up client_id, client_secret, host
  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']);
  variable_set('pmpapi_user_id', $vars['user_id']);
  $this
    ->createTestOrg();
  $this
    ->createTestGroup();

  // Turn off caching
  variable_set('pmpapi_cache', FALSE);
  $this
    ->assertTrue(variable_get('pmpapi_push_push_active'), 'Push is active.');

  // Set up node mapping
  $node_settings = array(
    'entity_type' => 'node',
    'bundle_name' => $this->nodetype,
    'target_profile' => 'story',
    'mapping' => array(
      'title' => 'title',
      'body' => 'contentencoded',
    ),
  );
  $this
    ->setUpEntityMapping($node_settings);
}