protected function PasswordPolicyExpirationTestCase::setExpirationPolicy in Password Policy 7
Sets expiration policy.
Has Policy Maker user create and enable an expiration policy.
Parameters
int $expiration: Number of days after which password expires.
int $rid: (optional) Role ID to which this policy should apply.
string $warning: (optional) Comma-delimited list of numbers of days before expiration on which expiration warnings are to be sent.
7 calls to PasswordPolicyExpirationTestCase::setExpirationPolicy()
- PasswordPolicyExpirationTestCase::testAdminExpirationDisabled in tests/
password_policy_expiration.test - Tests "Admin (UID=1) password expires" being disabled (i.e., unchecked).
- PasswordPolicyExpirationTestCase::testAdminExpirationEnabled in tests/
password_policy_expiration.test - Tests "Admin (UID=1) password expires" being enabled (i.e., checked).
- PasswordPolicyExpirationTestCase::testUnblockingExpiredAccountViaUserEditForm in tests/
password_policy_expiration.test - Tests unblocking an expired account via user edit form.
- PasswordPolicyExpirationTestCase::testUnblockingReblockedAccount in tests/
password_policy_expiration.test - Tests unblocking a "reblocked" account.
- PasswordPolicyExpirationTestCase::testWarningEmails in tests/
password_policy_expiration.test - Tests expiration warning e-mails.
File
- tests/
password_policy_expiration.test, line 503 - Tests for Password policy module expiration functionality.
Class
- PasswordPolicyExpirationTestCase
- Tests of password expiration.
Code
protected function setExpirationPolicy($expiration, $rid = DRUPAL_AUTHENTICATED_RID, $warning = '') {
$policy_maker = $this->policyMaker;
$this
->drupalLogin($policy_maker);
$name = $this
->createExpirationPolicy($expiration, $rid, $warning);
$this
->enablePolicy($name);
$this
->drupalLogout();
}