You are here

public function AgreementDefaultsPrivilegedUserTestCase::testAgreement in Agreement 6

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

File

./agreement.test, line 126
Tests for the Agreement module

Class

AgreementDefaultsPrivilegedUserTestCase

Code

public function testAgreement() {

  // After save, re-open agreement settings
  $this
    ->assertEqual($this
    ->getUrl(), $this->base_url . '/admin/settings/agreement', 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();
}