4 require_once(
"libs/composer/vendor/autoload.php");
39 $this->df =
new Data\Factory();
40 $this->lng = $this->createMock(\ilLanguage::class);
41 $this->refinery = new \ILIAS\Refinery\Factory($this->df, $this->lng);
43 $group = $this->refinery->custom();
45 $this->not_true = $this->refinery->logical()->not($group->constraint(
52 $this->not_false = $this->refinery->logical()->not($group->constraint(
62 $this->assertTrue($this->not_false->accepts(null));
67 $this->assertFalse($this->not_true->accepts(null));
72 $this->not_false->check(null);
73 $this->assertTrue(
true);
78 $this->expectException(\UnexpectedValueException::class);
79 $this->not_true->check(null);
84 $this->assertNull($this->not_false->problemWith(null));
90 ->expects($this->once())
95 $this->assertEquals(
"-not_true-", $this->not_true->problemWith(null));
100 $ok = $this->df->ok(null);
102 $res = $this->not_false->applyTo(
$ok);
103 $this->assertTrue(
$res->isOk());
108 $not_ok = $this->df->ok(null);
110 $res = $this->not_true->applyTo($not_ok);
111 $this->assertFalse(
$res->isOk());
116 $error = $this->df->error(
"error");
118 $res = $this->not_false->applyTo($error);
119 $this->assertSame($error,
$res);
124 $new_c = $this->not_true->withProblemBuilder(
function () {
125 return "This was a fault";
127 $this->assertEquals(
"This was a fault", $new_c->problemWith(null));
foreach($_POST as $key=> $value) $res