You are here

function PardotFunctionalityTestCase::testSettingsAndJSAddition in Pardot Integration 6

Verify that settings work and that basic JS Addition is functional.

File

./pardot.test, line 28

Class

PardotFunctionalityTestCase
Basic Pardot Test Case implementation.

Code

function testSettingsAndJSAddition() {

  // 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,
  );
  $this
    ->drupalPost('admin/settings/pardot', $options, t('Save configuration'));
  $this
    ->assertRaw(t('The configuration options have been saved.'), t('Pardot configuration saved.'));
  $this
    ->drupalGet('node');
  $this
    ->assertRaw('piAId = "12345"', 'Pardot account id added to page.');
  $this
    ->assertRaw('piCId = "23456"', 'Pardot default campaign added to page.');
  $this
    ->_testCampaignJS();
  $this
    ->_testScoringJS();
}