Definition at line 25 of file IsNumericConstraintTest.php.
◆ setUp()
IsNumericConstraintTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 32 of file IsNumericConstraintTest.php.
32 : void
33 {
34 $this->df = new DataFactory();
35 $this->
lng = $this->createMock(
ILIAS\Language\Language::class);
36
37 $this->f =
new Refinery($this->df, $this->
lng);
38
39 $this->c = $this->f->numeric()->isNumeric();
40 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
References ILIAS\Repository\lng().
◆ testAccepts1()
IsNumericConstraintTest::testAccepts1 |
( |
| ) |
|
◆ testAccepts2()
IsNumericConstraintTest::testAccepts2 |
( |
| ) |
|
◆ testAccepts3()
IsNumericConstraintTest::testAccepts3 |
( |
| ) |
|
◆ testAccepts4()
IsNumericConstraintTest::testAccepts4 |
( |
| ) |
|
◆ testAccepts5()
IsNumericConstraintTest::testAccepts5 |
( |
| ) |
|
◆ testAccepts6()
IsNumericConstraintTest::testAccepts6 |
( |
| ) |
|
◆ testAccepts7()
IsNumericConstraintTest::testAccepts7 |
( |
| ) |
|
◆ testAccepts8()
IsNumericConstraintTest::testAccepts8 |
( |
| ) |
|
◆ testCheckFails()
IsNumericConstraintTest::testCheckFails |
( |
| ) |
|
Definition at line 98 of file IsNumericConstraintTest.php.
98 : void
99 {
101 ->method('txt')
102 ->willReturnCallback(static function (string $value): string {
103 return $value;
104 })
105 ;
106 $this->expectException(\UnexpectedValueException::class);
107 $this->c->check("");
108 }
References ILIAS\Repository\lng().
◆ testCheckSucceed()
IsNumericConstraintTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
IsNumericConstraintTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts1()
IsNumericConstraintTest::testNotAccepts1 |
( |
| ) |
|
◆ testNotAccepts2()
IsNumericConstraintTest::testNotAccepts2 |
( |
| ) |
|
◆ testProblemWith()
IsNumericConstraintTest::testProblemWith |
( |
| ) |
|
Definition at line 115 of file IsNumericConstraintTest.php.
115 : void
116 {
118 ->expects($this->once())
119 ->method("txt")
120 ->with("not_numeric")
121 ->willReturn("-%s-");
122
123 $this->assertEquals("-aa-", $this->c->problemWith("aa"));
124 }
References ILIAS\Repository\lng().
◆ testRestrictError()
IsNumericConstraintTest::testRestrictError |
( |
| ) |
|
Definition at line 148 of file IsNumericConstraintTest.php.
148 : void
149 {
150 $error = $this->df->error("error");
151
152 $res = $this->c->applyTo($error);
153 $this->assertSame($error,
$res);
154 }
References $res.
◆ testRestrictNotOk()
IsNumericConstraintTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 134 of file IsNumericConstraintTest.php.
134 : void
135 {
136 $not_ok = $this->df->ok("");
137
139 ->expects($this->once())
140 ->method("txt")
141 ->with("not_numeric_empty_string")
142 ->willReturn("-%s-");
143
144 $res = $this->c->applyTo($not_ok);
145 $this->assertFalse(
$res->isOk());
146 }
References $res, and ILIAS\Repository\lng().
◆ testRestrictOk()
IsNumericConstraintTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
IsNumericConstraintTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 156 of file IsNumericConstraintTest.php.
156 : void
157 {
158 $new_c = $this->c->withProblemBuilder(static function (): string {
159 return "This was a fault";
160 });
161 $this->assertEquals("This was a fault", $new_c->problemWith(""));
162 }
◆ $c
ILIAS Refinery Constraint IsNumericConstraintTest::$c |
|
private |
◆ $df
DataFactory IsNumericConstraintTest::$df |
|
private |
◆ $f
Refinery IsNumericConstraintTest::$f |
|
private |
◆ $lng
ILIAS Language Language IsNumericConstraintTest::$lng |
|
private |
The documentation for this class was generated from the following file: