You are here

public function AgreementMultipleRoleTestCase::testAgreementForSecondRole in Agreement 7.2

Asserts that the user with the second role gets the agreement page.

File

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

Class

AgreementMultipleRoleTestCase
Tests multiple roles applying to an agreement.

Code

public function testAgreementForSecondRole() {

  // Creates user, login and assert agreement page.
  $requiredUser = $this
    ->requiredUserLogin($this->requiredSecondRole, 'second role');
  $this
    ->isAgreementPage($this->agreement);

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

  // Go anywhere else, open agreement.
  $this
    ->drupalGet('user/' . $requiredUser->uid);
  $this
    ->isAgreementPage($this->agreement);

  // Try submitting agreement form.
  $this
    ->submitAgreementFormWithoutAgreeing($requiredUser->uid);
  $this
    ->submitAgreementFormWithAgreeing($requiredUser->uid);
}