You are here

public function PardotFunctionalityTestCase::setUp in Pardot Integration 8

Same name and namespace in other branches
  1. 6 pardot.test \PardotFunctionalityTestCase::setUp()
  2. 7.2 pardot.test \PardotFunctionalityTestCase::setUp()
  3. 7 pardot.test \PardotFunctionalityTestCase::setUp()

File

./pardot.test, line 20
Pardot web tests.

Class

PardotFunctionalityTestCase
Basic Pardot Test Case implementation.

Code

public function setUp(array $modules = array()) {
  $modules[] = 'webform';
  $modules[] = 'pardot';
  $modules[] = 'path';
  parent::setUp($modules);

  // Create an administrator user.
  $permissions = array(
    'administer pardot',
  );
  $user = $this
    ->drupalCreateUser($permissions);
  $this
    ->drupalLogin($user);

  // Set basic settings.
  $options = array(
    'pardot_a_id' => 12345,
    'pardot_c_id' => 23456,
  );
  $drupal_settings = $this
    ->drupalGetSettings();
  $drupal_settings += $options;
  $this
    ->drupalSetSettings($drupal_settings);
  $this
    ->drupalPost('admin/config/services/pardot', $options, t('Save configuration'));
  $this
    ->assertRaw(t('The configuration options have been saved.'), t('Pardot configuration saved.'));
}