◆ setUp()
| SequentialTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 33 of file SequentialConstraintTest.php.
33 : void
34 {
35 $this->df = new DataFactory();
36 $this->
lng = $this->createMock(ilLanguage::class);
37 $this->
refinery =
new Refinery($this->df, $this->
lng);
38
40
41 $greater_than_3 = $group->constraint(
42 function ($value) {
43 return $value > 3;
44 },
45 "not_greater_than_3"
46 );
47
48 $less_than_5 = $group->constraint(
49 function ($value) {
50 return $value < 5;
51 },
52 "not_less_than_5"
53 );
54
56 ->logical()
57 ->sequential([$greater_than_3, $less_than_5]);
58 }
References ILIAS\Repository\lng(), and ILIAS\Repository\refinery().
◆ testAccepts()
| SequentialTest::testAccepts |
( |
| ) |
|
◆ testCheckFails()
| SequentialTest::testCheckFails |
( |
| ) |
|
Definition at line 76 of file SequentialConstraintTest.php.
76 : void
77 {
78 $this->expectException(UnexpectedValueException::class);
79 $this->c->check(2);
80 }
◆ testCheckSucceed()
| SequentialTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
| SequentialTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts()
| SequentialTest::testNotAccepts |
( |
| ) |
|
◆ testProblemWith1()
| SequentialTest::testProblemWith1 |
( |
| ) |
|
◆ testProblemWith2()
| SequentialTest::testProblemWith2 |
( |
| ) |
|
◆ testRestrictError()
| SequentialTest::testRestrictError |
( |
| ) |
|
Definition at line 121 of file SequentialConstraintTest.php.
121 : void
122 {
123 $error = $this->df->error("error");
124
125 $res = $this->c->applyTo($error);
126 $this->assertSame($error,
$res);
127 }
References $res.
◆ testRestrictNotOk()
| SequentialTest::testRestrictNotOk |
( |
| ) |
|
◆ testRestrictOk()
| SequentialTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
| SequentialTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 129 of file SequentialConstraintTest.php.
129 : void
130 {
131 $new_c = $this->c->withProblemBuilder(static function (): string {
132 return "This was a fault";
133 });
134 $this->assertEquals("This was a fault", $new_c->problemWith(7));
135 }
◆ $c
◆ $df
| DataFactory SequentialTest::$df |
|
private |
◆ $lng
◆ $refinery
| Refinery SequentialTest::$refinery |
|
private |
The documentation for this class was generated from the following file: