ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
PasswordContraintsTest Class Reference
+ Inheritance diagram for PasswordContraintsTest:
+ Collaboration diagram for PasswordContraintsTest:

Public Member Functions

 testAccept (Constraint $constraint, array $ok_values, array $error_values)
 constraintsProvider More...
 

Static Public Member Functions

static constraintsProvider ()
 Test a set of values. More...
 

Detailed Description

Definition at line 24 of file PasswordContraintsTest.php.

Member Function Documentation

◆ constraintsProvider()

static PasswordContraintsTest::constraintsProvider ( )
static

Test a set of values.

Returns
array[[$constraint,$ok_values,$error_values]]

Definition at line 31 of file PasswordContraintsTest.php.

References Vendor\Package\$d, $lng, and ILIAS\UI\examples\Layout\Page\Standard\$refinery.

31  : array
32  {
33  $lng = new class () implements \ILIAS\Language\Language {
34  public function txt(string $a_topic, string $a_default_lang_fallback_mod = ""): string
35  {
36  return $a_topic;
37  }
38  public function loadLanguageModule(string $a_module): void
39  {
40  }
41  };
42  $d = new \ILIAS\Data\Factory();
43  $refinery = new \ILIAS\Refinery\Factory($d, $lng);
44  $v = $refinery->password();
45 
46  return [
47  [
48  $v->hasMinLength(3),
49  [$d->password('abc'), $d->password('abcd')],
50  [$d->password('a'), $d->password('ab')]
51  ],
52  [
53  $v->hasLowerChars(),
54  [$d->password('abc'), $d->password('AbC')],
55  [$d->password('AB'), $d->password('21'), $d->password('#*+')]
56  ],
57 
58  [
59  $v->hasUpperChars(),
60  [$d->password('Abc'), $d->password('ABC')],
61  [$d->password('abc'), $d->password('21'), $d->password('#*+')]
62  ],
63  [
64  $v->hasNumbers(),
65  [$d->password('Ab1'), $d->password('123')],
66  [$d->password('abc'), $d->password('ABC'), $d->password('#*+')]
67  ],
68 
69  [
70  $v->hasSpecialChars(),
71  [$d->password('Ab+'), $d->password('123#')],
72  [$d->password('abc'), $d->password('ABC'), $d->password('123')]
73  ]
74  ];
75  }
Interface Observer Contains several chained tasks and infos about them.
global $lng
Definition: privfeed.php:32

◆ testAccept()

PasswordContraintsTest::testAccept ( Constraint  $constraint,
array  $ok_values,
array  $error_values 
)

constraintsProvider

Parameters
Constraint$constraint
ILIAS

Definition at line 83 of file PasswordContraintsTest.php.

References ILIAS\Refinery\Constraint\accepts().

83  : void
84  {
85  foreach ($ok_values as $ok_value) {
86  $this->assertTrue($constraint->accepts($ok_value));
87  }
88  foreach ($error_values as $error_value) {
89  $this->assertFalse($constraint->accepts($error_value));
90  }
91  }
accepts($value)
Tells if the provided value complies.
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: