You are here

public function PardotFunctionalityTestCase::testScoringJS in Pardot Integration 7.2

Same name and namespace in other branches
  1. 8 pardot.test \PardotFunctionalityTestCase::testScoringJS()
  2. 7 pardot.test \PardotFunctionalityTestCase::testScoringJS()

File

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

Class

PardotFunctionalityTestCase
Basic Pardot Test Case implementation.

Code

public function testScoringJS() {

  // Add a campaign.
  $this
    ->drupalPost('admin/config/services/pardot/scoring', array(
    'path' => 'user',
    'score' => '50',
  ), t('Add'));
  $this
    ->drupalGet('node');
  $drupal_settings = $this
    ->drupalGetSettings();
  $this
    ->assertFalse($drupal_settings['pardot']['score'], 'No Pardot scoring on general page.');
  $this
    ->drupalGet('user');
  $drupal_settings = $this
    ->drupalGetSettings();
  $this
    ->assertEqual($drupal_settings['pardot']['score'], '50', 'Pardot scoring found on scored page.');

  // Modify a campaign.
  $this
    ->drupalPost("admin/config/services/pardot/scoring/1/edit", array(
    'path' => 'user',
    'score' => '60',
  ), t('Save'));
  $this
    ->drupalGet('node');
  $drupal_settings = $this
    ->drupalGetSettings();
  $this
    ->assertFalse($drupal_settings['pardot']['score'], 'No Pardot scoring on general page after modification.');
  $this
    ->drupalGet('user');
  $drupal_settings = $this
    ->drupalGetSettings();
  $this
    ->assertEqual($drupal_settings['pardot']['score'], '60', 'Pardot scoring found on scored page after modification.');

  // Delete a campaign.
  $this
    ->drupalPost("admin/config/services/pardot/scoring/1/delete", array(), t('Delete'));
  $this
    ->drupalGet('user');
  $drupal_settings = $this
    ->drupalGetSettings();
  $this
    ->assertFalse($drupal_settings['pardot']['score'], 'Pardot scoring not found on scored page after deletion.');
}