You are here

public function AgreementDefaultsPrivilegedUserTestCase::testAgreement in Agreement 6.2

Same name and namespace in other branches
  1. 6 agreement.test \AgreementDefaultsPrivilegedUserTestCase::testAgreement()
  2. 7.2 agreement.test \AgreementDefaultsPrivilegedUserTestCase::testAgreement()

File

./agreement.test, line 133
Tests for Agreement module.

Class

AgreementDefaultsPrivilegedUserTestCase

Code

public function testAgreement() {

  // After save, re-open agreement settings
  $this
    ->assertUrl('admin/settings/agreement', array(), t('URL of settings page is correct') . ': ' . $this
    ->getUrl());
  $this
    ->assertTitle(t('Agreement settings') . $this->site_name, t('Page title of settings page is correct'));

  // Go to front page, no agreement
  $this
    ->drupalGet('node');
  $this
    ->isNotAgreementPage();

  // Go anywhere else, open agreement
  $this
    ->drupalGet('admin');
  $this
    ->isAgreementPage();

  // Try to go somewhere without submitting
  $this
    ->drupalGet('node/add');
  $this
    ->isAgreementPage();

  // Try submitting agreement form
  $this
    ->submitAgreementFormWithoutAgreeing($this->privileged_user->uid);
  $this
    ->submitAgreementFormWithAgreeing($this->privileged_user->uid);
  $this
    ->drupalGet('admin');
  $this
    ->isNotAgreementPage();
}