Test standard-constraints of a password.
More...
◆ constraintsProvider()
PasswordContraintsTest::constraintsProvider |
( |
| ) |
|
Test a set of values.
- Returns
- array[[$constraint,$ok_values,$error_values]]
Definition at line 23 of file PasswordContraintsTest.php.
References $d, and $lng.
25 $lng = $this->createMock(\ilLanguage::class);
26 $d = new \ILIAS\Data\Factory();
27 $validation = new \ILIAS\Validation\Factory(
$d,
$lng);
28 $v = $validation->password();
33 [
$d->password(
'abc'),
$d->password(
'abcd')],
34 [
$d->password(
'a'),
$d->password(
'ab')]
38 [
$d->password(
'abc'),
$d->password(
'AbC')],
39 [
$d->password(
'AB'),
$d->password(
'21'),
$d->password(
'#*+')]
44 [
$d->password(
'Abc'),
$d->password(
'ABC')],
45 [
$d->password(
'abc'),
$d->password(
'21'),
$d->password(
'#*+')]
49 [
$d->password(
'Ab1'),
$d->password(
'123')],
50 [
$d->password(
'abc'),
$d->password(
'ABC'),
$d->password(
'#*+')]
54 $v->hasSpecialChars(),
55 [
$d->password(
'Ab+'),
$d->password(
'123#')],
56 [
$d->password(
'abc'),
$d->password(
'ABC'),
$d->password(
'123')]
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
◆ testAccept()
PasswordContraintsTest::testAccept |
( |
|
$constraint, |
|
|
|
$ok_values, |
|
|
|
$error_values |
|
) |
| |
constraintsProvider
Definition at line 64 of file PasswordContraintsTest.php.
66 foreach ($ok_values as $ok_value) {
67 $this->assertTrue($constraint->accepts($ok_value));
69 foreach ($error_values as $error_value) {
70 $this->assertFalse($constraint->accepts($error_value));
The documentation for this class was generated from the following file: