◆ setUp()
HasMaxLengthConstraintTest::setUp |
( |
| ) |
|
Definition at line 32 of file HasMaxLengthConstraintTest.php.
32 : void
33 {
34 $this->df = new Data\Factory();
35 $this->lng = $this->createMock(\ilLanguage::class);
36
37 $this->max_length = 2;
38
39 $this->c = new \ILIAS\Refinery\String\HasMaxLength(
40 $this->max_length,
41 $this->df,
42 $this->lng
43 );
44 }
◆ testAccepts1()
HasMaxLengthConstraintTest::testAccepts1 |
( |
| ) |
|
◆ testAccepts2()
HasMaxLengthConstraintTest::testAccepts2 |
( |
| ) |
|
◆ testCheckFails()
HasMaxLengthConstraintTest::testCheckFails |
( |
| ) |
|
◆ testCheckSucceed()
HasMaxLengthConstraintTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
HasMaxLengthConstraintTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts()
HasMaxLengthConstraintTest::testNotAccepts |
( |
| ) |
|
◆ testProblemWith()
HasMaxLengthConstraintTest::testProblemWith |
( |
| ) |
|
Definition at line 78 of file HasMaxLengthConstraintTest.php.
79 {
80 $this->lng
81 ->expects($this->once())
82 ->method("txt")
83 ->with("not_max_length")
84 ->willReturn("-%s-");
85
86 $this->assertEquals("-2-", $this->c->problemWith("123"));
87 }
◆ testRestrictError()
HasMaxLengthConstraintTest::testRestrictError |
( |
| ) |
|
Definition at line 105 of file HasMaxLengthConstraintTest.php.
106 {
107 $error = $this->df->error("error");
108
109 $res = $this->c->applyTo($error);
110 $this->assertSame($error,
$res);
111 }
foreach($_POST as $key=> $value) $res
References $res.
◆ testRestrictNotOk()
HasMaxLengthConstraintTest::testRestrictNotOk |
( |
| ) |
|
◆ testRestrictOk()
HasMaxLengthConstraintTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
HasMaxLengthConstraintTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 113 of file HasMaxLengthConstraintTest.php.
114 {
115 $new_c = $this->c->withProblemBuilder(function () {
116 return "This was a fault";
117 });
118 $this->assertEquals("This was a fault", $new_c->problemWith("123"));
119 }
◆ $c
HasMaxLengthConstraintTest::$c |
|
private |
◆ $df
HasMaxLengthConstraintTest::$df |
|
private |
◆ $lng
HasMaxLengthConstraintTest::$lng |
|
private |
◆ $max_length
HasMaxLengthConstraintTest::$max_length |
|
private |
The documentation for this class was generated from the following file: