◆ setUp()
HasMinLengthConstraintTest::setUp |
( |
| ) |
|
Definition at line 11 of file HasMinLengthConstraintTest.php.
13 $this->df =
new Data\Factory();
14 $this->lng = $this->createMock(\ilLanguage::class);
15 $this->f =
new Validation\Factory($this->df, $this->lng);
17 $this->min_length = 10;
19 $this->c = $this->f->hasMinLength($this->min_length);
◆ testAccepts1()
HasMinLengthConstraintTest::testAccepts1 |
( |
| ) |
|
◆ testAccepts2()
HasMinLengthConstraintTest::testAccepts2 |
( |
| ) |
|
◆ testCheckFails()
HasMinLengthConstraintTest::testCheckFails |
( |
| ) |
|
◆ testCheckSucceed()
HasMinLengthConstraintTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
HasMinLengthConstraintTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts()
HasMinLengthConstraintTest::testNotAccepts |
( |
| ) |
|
◆ testProblemWith()
HasMinLengthConstraintTest::testProblemWith |
( |
| ) |
|
Definition at line 54 of file HasMinLengthConstraintTest.php.
References Sabre\Event\once().
57 ->expects($this->
once())
59 ->with(
"not_min_length")
60 ->willReturn(
"-%s-%s-");
62 $this->assertEquals(
"-3-10-", $this->c->problemWith(
"123"));
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
◆ testRestrictError()
HasMinLengthConstraintTest::testRestrictError |
( |
| ) |
|
Definition at line 81 of file HasMinLengthConstraintTest.php.
References $res.
83 $error = $this->df->error(
"error");
85 $res = $this->c->restrict($error);
86 $this->assertSame($error,
$res);
foreach($_POST as $key=> $value) $res
◆ testRestrictNotOk()
HasMinLengthConstraintTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 73 of file HasMinLengthConstraintTest.php.
References $res.
75 $not_ok = $this->df->ok(
"1234");
77 $res = $this->c->restrict($not_ok);
78 $this->assertFalse(
$res->isOk());
foreach($_POST as $key=> $value) $res
◆ testRestrictOk()
HasMinLengthConstraintTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
HasMinLengthConstraintTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 89 of file HasMinLengthConstraintTest.php.
91 $new_c = $this->c->withProblemBuilder(
function () {
92 return "This was a fault";
94 $this->assertEquals(
"This was a fault", $new_c->problemWith(
""));
The documentation for this class was generated from the following file: