TestCase for the sequential constraint.
More...
◆ setUp()
SequentialTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 42 of file SequentialConstraintTest.php.
44 $this->df =
new Data\Factory();
45 $this->lng = $this->createMock(\ilLanguage::class);
46 $this->refinery = new \ILIAS\Refinery\Factory($this->df, $this->lng);
48 $group = $this->refinery->custom();
50 $this->greater_than_3 = $group->constraint(
57 $this->less_than_5 = $group->constraint(
64 $this->c = $this->refinery
66 ->sequential([$this->greater_than_3, $this->less_than_5]);
◆ testAccepts()
SequentialTest::testAccepts |
( |
| ) |
|
◆ testCheckFails()
SequentialTest::testCheckFails |
( |
| ) |
|
◆ testCheckSucceed()
SequentialTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
SequentialTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts()
SequentialTest::testNotAccepts |
( |
| ) |
|
◆ testProblemWith1()
SequentialTest::testProblemWith1 |
( |
| ) |
|
Definition at line 96 of file SequentialConstraintTest.php.
99 ->expects($this->never())
102 $this->assertEquals(
"not_greater_than_3", $this->c->problemWith(2));
◆ testProblemWith2()
SequentialTest::testProblemWith2 |
( |
| ) |
|
Definition at line 105 of file SequentialConstraintTest.php.
108 ->expects($this->never())
111 $this->assertEquals(
"not_less_than_5", $this->c->problemWith(6));
◆ testRestrictError()
SequentialTest::testRestrictError |
( |
| ) |
|
Definition at line 130 of file SequentialConstraintTest.php.
References $res.
132 $error = $this->df->error(
"error");
134 $res = $this->c->applyTo($error);
135 $this->assertSame($error,
$res);
foreach($_POST as $key=> $value) $res
◆ testRestrictNotOk()
SequentialTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 122 of file SequentialConstraintTest.php.
References $res.
124 $not_ok = $this->df->ok(7);
126 $res = $this->c->applyTo($not_ok);
127 $this->assertFalse(
$res->isOk());
foreach($_POST as $key=> $value) $res
◆ testRestrictOk()
SequentialTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
SequentialTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 138 of file SequentialConstraintTest.php.
140 $new_c = $this->c->withProblemBuilder(
function () {
141 return "This was a fault";
143 $this->assertEquals(
"This was a fault", $new_c->problemWith(7));
◆ $df
◆ $greater_than_3
SequentialTest::$greater_than_3 |
|
private |
◆ $less_than_5
SequentialTest::$less_than_5 |
|
private |
◆ $lng
◆ $refinery
SequentialTest::$refinery |
|
private |
The documentation for this class was generated from the following file: