public function AgreementDefaultsUnprivilegedUserTestCase::testAgreement in Agreement 6.2
Same name and namespace in other branches
- 6 agreement.test \AgreementDefaultsUnprivilegedUserTestCase::testAgreement()
- 7.2 agreement.test \AgreementDefaultsUnprivilegedUserTestCase::testAgreement()
File
- ./
agreement.test, line 171 - Tests for 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.'));
}