Definition at line 9 of file IsStringConstraintTest.php.
◆ setUp()
IsStringConstraintTest::setUp |
( |
| ) |
|
Definition at line 11 of file IsStringConstraintTest.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->c = $this->f->isString();
◆ testAccepts()
IsStringConstraintTest::testAccepts |
( |
| ) |
|
◆ testCheckFails()
IsStringConstraintTest::testCheckFails |
( |
| ) |
|
◆ testCheckSucceed()
IsStringConstraintTest::testCheckSucceed |
( |
| ) |
|
◆ testNoProblemWith()
IsStringConstraintTest::testNoProblemWith |
( |
| ) |
|
◆ testNotAccepts()
IsStringConstraintTest::testNotAccepts |
( |
| ) |
|
◆ testProblemWith()
IsStringConstraintTest::testProblemWith |
( |
| ) |
|
Definition at line 47 of file IsStringConstraintTest.php.
References Sabre\Event\once().
50 ->expects($this->
once())
52 ->with(
"not_a_string")
55 $this->assertEquals(
"-double-", $this->c->problemWith(2.2));
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
◆ testRestrictError()
IsStringConstraintTest::testRestrictError |
( |
| ) |
|
Definition at line 74 of file IsStringConstraintTest.php.
References $res.
76 $error = $this->df->error(
"error");
78 $res = $this->c->restrict($error);
79 $this->assertSame($error,
$res);
foreach($_POST as $key=> $value) $res
◆ testRestrictNotOk()
IsStringConstraintTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 66 of file IsStringConstraintTest.php.
References $res.
68 $not_ok = $this->df->ok(2);
70 $res = $this->c->restrict($not_ok);
71 $this->assertFalse(
$res->isOk());
foreach($_POST as $key=> $value) $res
◆ testRestrictOk()
IsStringConstraintTest::testRestrictOk |
( |
| ) |
|
◆ testWithProblemBuilder()
IsStringConstraintTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 82 of file IsStringConstraintTest.php.
84 $new_c = $this->c->withProblemBuilder(
function () {
85 return "This was a fault";
87 $this->assertEquals(
"This was a fault", $new_c->problemWith(2.2));
The documentation for this class was generated from the following file: