public function AgreementCustomUnprivilegedUserTestCase::testAgreementFrequency in Agreement 6.2
Same name and namespace in other branches
- 7.2 agreement.test \AgreementCustomUnprivilegedUserTestCase::testAgreementFrequency()
File
- ./agreement.test, line 225
- Tests for Agreement module.
Class
- AgreementCustomUnprivilegedUserTestCase
Code
public function testAgreementFrequency() {
variable_set('agreement_page_visibility_settings', 1);
variable_set('agreement_page_visibility_pages', '<front>');
$this
->unprivilegedUserLogin();
$this
->drupalGet('node');
$this
->isAgreementPage();
$this
->submitAgreementFormWithAgreeing($this->unprivileged_user->uid);
$this
->drupalLogin($this->unprivileged_user);
$this
->drupalGet('node');
$this
->isNotAgreementPage();
variable_set('agreement_frequency', 1);
$this
->drupalLogin($this->unprivileged_user);
$this
->drupalGet('node');
$this
->isAgreementPage();
$this
->submitAgreementFormWithAgreeing($this->unprivileged_user->uid);
$this
->drupalLogin($this->unprivileged_user);
$this
->drupalGet('node');
$this
->isAgreementPage();
$this
->submitAgreementFormWithAgreeing($this->unprivileged_user->uid);
variable_set('agreement_page_visibility_pages', '');
$edit = array(
'pass[pass1]' => $pass = $this
->randomString(),
'pass[pass2]' => $pass,
);
$this
->drupalPost('user/' . $this->unprivileged_user->uid . '/edit', $edit, t('Save'));
$this
->isNotAgreementPage();
$this
->assertText(t('The changes have been saved.'), t('Password was changed'));
}