TestCase for the sequential constraint.
More...
◆ setUp()
SequentialTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 16 of file SequentialConstraintTest.php.
18 $this->df =
new Data\Factory();
19 $this->lng = $this->createMock(\ilLanguage::class);
20 $this->f =
new Validation\Factory($this->df, $this->lng);
22 $this->greater_than_3 = $this->f->custom(
29 $this->less_than_5 = $this->f->custom(
36 $this->c = $this->f->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 66 of file SequentialConstraintTest.php.
69 ->expects($this->never())
72 $this->assertEquals(
"not_greater_than_3", $this->c->problemWith(2));
◆ testProblemWith2()
SequentialTest::testProblemWith2 |
( |
| ) |
|
Definition at line 75 of file SequentialConstraintTest.php.
78 ->expects($this->never())
81 $this->assertEquals(
"not_less_than_5", $this->c->problemWith(6));
◆ testRestrictError()
SequentialTest::testRestrictError |
( |
| ) |
|
Definition at line 100 of file SequentialConstraintTest.php.
References $res.
102 $error = $this->df->error(
"error");
104 $res = $this->c->restrict($error);
105 $this->assertSame($error,
$res);
foreach($_POST as $key=> $value) $res
◆ testRestrictNotOk()
SequentialTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 92 of file SequentialConstraintTest.php.
References $res.
94 $not_ok = $this->df->ok(7);
96 $res = $this->c->restrict($not_ok);
97 $this->assertFalse(
$res->isOk());
foreach($_POST as $key=> $value) $res
◆ testRestrictOk()
SequentialTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
SequentialTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 108 of file SequentialConstraintTest.php.
110 $new_c = $this->c->withProblemBuilder(
function () {
111 return "This was a fault";
113 $this->assertEquals(
"This was a fault", $new_c->problemWith(7));
The documentation for this class was generated from the following file: