Definition at line 26 of file NotConstraintTest.php.
◆ setUp()
NotConstraintTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 34 of file NotConstraintTest.php.
34 : void
35 {
36 $this->df = new DataFactory();
37 $this->
lng = $this->createMock(
ILIAS\Language\Language::class);
38 $this->
refinery =
new Refinery($this->df, $this->
lng);
39
41
42 $this->not_true = $this->
refinery->logical()->not($group->constraint(
43 static function ($v): bool {
44 return true;
45 },
46 "not_true"
47 ));
48
49 $this->not_false = $this->
refinery->logical()->not($group->constraint(
50 static function ($v): bool {
51 return false;
52 },
53 "not_false"
54 ));
55 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
References ILIAS\Repository\lng(), and ILIAS\Repository\refinery().
◆ testAccepts()
NotConstraintTest::testAccepts |
( |
| ) |
|
Definition at line 57 of file NotConstraintTest.php.
57 : void
58 {
59 $this->assertTrue($this->not_false->accepts(null));
60 }
◆ testCheckFails()
NotConstraintTest::testCheckFails |
( |
| ) |
|
Definition at line 73 of file NotConstraintTest.php.
73 : void
74 {
75 $this->expectException(UnexpectedValueException::class);
76 $this->not_true->check(null);
77 }
◆ testCheckSucceed()
NotConstraintTest::testCheckSucceed |
( |
| ) |
|
Definition at line 67 of file NotConstraintTest.php.
67 : void
68 {
69 $this->not_false->check(null);
70 $this->assertTrue(true);
71 }
◆ testNoProblemWith()
NotConstraintTest::testNoProblemWith |
( |
| ) |
|
Definition at line 79 of file NotConstraintTest.php.
79 : void
80 {
81 $this->assertNull($this->not_false->problemWith(null));
82 }
◆ testNotAccepts()
NotConstraintTest::testNotAccepts |
( |
| ) |
|
Definition at line 62 of file NotConstraintTest.php.
62 : void
63 {
64 $this->assertFalse($this->not_true->accepts(null));
65 }
◆ testProblemWith()
NotConstraintTest::testProblemWith |
( |
| ) |
|
Definition at line 84 of file NotConstraintTest.php.
84 : void
85 {
87 ->expects($this->once())
88 ->method("txt")
89 ->with("not_generic")
90 ->willReturn("-%s-");
91
92 $this->assertEquals("-not_true-", $this->not_true->problemWith(null));
93 }
References ILIAS\Repository\lng().
◆ testRestrictError()
NotConstraintTest::testRestrictError |
( |
| ) |
|
Definition at line 111 of file NotConstraintTest.php.
111 : void
112 {
113 $error = $this->df->error("error");
114
115 $res = $this->not_false->applyTo($error);
116 $this->assertSame($error,
$res);
117 }
References $res.
◆ testRestrictNotOk()
NotConstraintTest::testRestrictNotOk |
( |
| ) |
|
Definition at line 103 of file NotConstraintTest.php.
103 : void
104 {
105 $not_ok = $this->df->ok(null);
106
107 $res = $this->not_true->applyTo($not_ok);
108 $this->assertFalse(
$res->isOk());
109 }
References $res.
◆ testRestrictOk()
NotConstraintTest::testRestrictOk |
( |
| ) |
|
Definition at line 95 of file NotConstraintTest.php.
95 : void
96 {
97 $ok = $this->df->ok(null);
98
99 $res = $this->not_false->applyTo($ok);
100 $this->assertTrue(
$res->isOk());
101 }
References $res.
◆ testWithProblemBuilder()
NotConstraintTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 119 of file NotConstraintTest.php.
119 : void
120 {
121 $new_c = $this->not_true->withProblemBuilder(static function (): string {
122 return "This was a fault";
123 });
124 $this->assertEquals("This was a fault", $new_c->problemWith(null));
125 }
◆ $df
DataFactory NotConstraintTest::$df |
|
private |
◆ $lng
ILIAS Language Language NotConstraintTest::$lng |
|
private |
◆ $not_false
◆ $not_true
◆ $refinery
Refinery NotConstraintTest::$refinery |
|
private |
The documentation for this class was generated from the following file: