public function AgreementDefaultsUnprivilegedUserTestCase::testAgreement in Agreement 6
Same name and namespace in other branches
- 6.2 agreement.test \AgreementDefaultsUnprivilegedUserTestCase::testAgreement()
- 7.2 agreement.test \AgreementDefaultsUnprivilegedUserTestCase::testAgreement()
File
- ./
agreement.test, line 164 - Tests for the Agreement module
Class
Code
public function testAgreement() {
$this
->unprivilegedUserLogin();
// Sent to agreement page
$this
->isAgreementPage();
// Go to front page, no agreement
$this
->drupalGet('node');
$this
->isNotAgreementPage();
// Go anywhere else, open agreement
$this
->drupalGet('user/' . $this->unprivileged_user->uid);
$this
->isAgreementPage();
// Try submitting agreement form
$this
->submitAgreementFormWithoutAgreeing($this->unprivileged_user->uid);
$this
->submitAgreementFormWithAgreeing(${$this}->unprivileged_user->uid);
$this
->drupalGet('admin/settings/agreement');
$this
->assertResponse(403, t('User is not allowed to access agreement settings page.'));
}