You are here

public function PasswordPolicyConstraintsTestCase::testIntCountConstraint in Password Policy 7.2

Tests integer count constraint.

File

./password_policy.test, line 266
Unit tests for Password policy module.

Class

PasswordPolicyConstraintsTestCase
Test case to verify accuracy of each available policy constraint.

Code

public function testIntCountConstraint() {
  $config = array(
    'int_count' => array(
      'int_count' => 1,
    ),
  );
  $policy = $this
    ->createPolicy($config);
  $this
    ->assertFalse($this
    ->checkPolicy($policy, ''), 'Integer count constraint fails with less than required integers.', 'Constraint');
  $this
    ->assertTrue($this
    ->checkPolicy($policy, '1'), 'Integer count constraint passes with minimum required integers.', 'Constraint');
  $this
    ->assertTrue($this
    ->checkPolicy($policy, '12'), 'Integer count constraint passes with more than required integers.', 'Constraint');
}