public function AgreementMultipleRoleTestCase::testAgreementForFirstRole in Agreement 7.2
Asserts that the user with the first role gets the agreement page.
File
- ./
agreement.test, line 677 - Tests for Agreement module.
Class
- AgreementMultipleRoleTestCase
- Tests multiple roles applying to an agreement.
Code
public function testAgreementForFirstRole() {
// Creates user, login and assert agreement page.
$requiredUser = $this
->requiredUserLogin($this->requiredRole, 'first 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);
}