TestCase for the parellel constraint.
More...
◆ setUp()
Definition at line 16 of file ParallelConstraintsTest.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->less_than_3 = $this->f->custom(
29 $this->less_than_5 = $this->f->custom(
36 $this->c = $this->f->parallel([$this->less_than_3, $this->less_than_5]);
◆ testAccepts()
ParallelTest::testAccepts |
( |
| ) |
|
◆ testCheckFails()
ParallelTest::testCheckFails |
( |
| ) |
|
◆ testCheckSucceed()
ParallelTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
ParallelTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts()
ParallelTest::testNotAccepts |
( |
| ) |
|
◆ testProblemWith1()
ParallelTest::testProblemWith1 |
( |
| ) |
|
Definition at line 66 of file ParallelConstraintsTest.php.
69 ->expects($this->never())
72 $this->assertEquals(
"not_less_than_3", $this->c->problemWith(4));
◆ testProblemWith2()
ParallelTest::testProblemWith2 |
( |
| ) |
|
Definition at line 75 of file ParallelConstraintsTest.php.
78 ->expects($this->never())
81 $this->assertEquals(
"not_less_than_3 not_less_than_5", $this->c->problemWith(6));
◆ testRestrictError()
ParallelTest::testRestrictError |
( |
| ) |
|
Definition at line 100 of file ParallelConstraintsTest.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()
ParallelTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 92 of file ParallelConstraintsTest.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()
ParallelTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
ParallelTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 108 of file ParallelConstraintsTest.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: