◆ setUp()
HasMaxLengthConstraintTest::setUp |
( |
| ) |
|
Definition at line 11 of file HasMaxLengthConstraintTest.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->max_length = 2;
19 $this->c = $this->f->hasMaxLength($this->max_length);
◆ testAccepts1()
HasMaxLengthConstraintTest::testAccepts1 |
( |
| ) |
|
◆ testAccepts2()
HasMaxLengthConstraintTest::testAccepts2 |
( |
| ) |
|
◆ testCheckFails()
HasMaxLengthConstraintTest::testCheckFails |
( |
| ) |
|
◆ testCheckSucceed()
HasMaxLengthConstraintTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
HasMaxLengthConstraintTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts()
HasMaxLengthConstraintTest::testNotAccepts |
( |
| ) |
|
◆ testProblemWith()
HasMaxLengthConstraintTest::testProblemWith |
( |
| ) |
|
Definition at line 54 of file HasMaxLengthConstraintTest.php.
References Sabre\Event\once().
57 ->expects($this->
once())
59 ->with(
"not_max_length")
62 $this->assertEquals(
"-2-", $this->c->problemWith(
"123"));
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
◆ testRestrictError()
HasMaxLengthConstraintTest::testRestrictError |
( |
| ) |
|
Definition at line 81 of file HasMaxLengthConstraintTest.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()
HasMaxLengthConstraintTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 73 of file HasMaxLengthConstraintTest.php.
References $res.
75 $not_ok = $this->df->ok(
"123");
77 $res = $this->c->restrict($not_ok);
78 $this->assertFalse(
$res->isOk());
foreach($_POST as $key=> $value) $res
◆ testRestrictOk()
HasMaxLengthConstraintTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
HasMaxLengthConstraintTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 89 of file HasMaxLengthConstraintTest.php.
91 $new_c = $this->c->withProblemBuilder(
function () {
92 return "This was a fault";
94 $this->assertEquals(
"This was a fault", $new_c->problemWith(
"123"));
The documentation for this class was generated from the following file: