19declare(strict_types=1);
24use PHPUnit\Framework\TestCase;
28 private DataFactory
$df;
32 protected function setUp(): void
34 $this->df =
new DataFactory();
36 $this->createStub(
ILIAS\Language\Language::class)
42 $this->assertTrue($this->not_false->accepts(
null));
47 $this->assertFalse($this->not_true->accepts(
null));
52 $this->not_false->check(
null);
53 $this->assertTrue(
true);
58 $this->expectException(UnexpectedValueException::class);
59 $this->not_true->check(
null);
64 $this->assertNull($this->not_false->problemWith(
null));
69 $lng = $this->createMock(
ILIAS\Language\Language::class);
71 ->expects($this->once())
83 $ok = $this->df->ok(
null);
85 $res = $this->not_false->applyTo($ok);
86 $this->assertTrue(
$res->isOk());
91 $not_ok = $this->df->ok(
null);
93 $res = $this->not_true->applyTo($not_ok);
94 $this->assertFalse(
$res->isOk());
99 $error = $this->df->error(
'error');
101 $res = $this->not_false->applyTo($error);
102 $this->assertSame($error,
$res);
107 $new_c = $this->not_true->withProblemBuilder(
static fn():
string =>
'This was a fault');
108 $this->assertEquals(
'This was a fault', $new_c->problemWith(
null));
120 $refinery->logical()->not($group->constraint(
121 static fn($v):
bool =>
true,
124 $refinery->logical()->not($group->constraint(
125 static fn($v):
bool =>
false,
notConstraints(ILIAS\Language\Language $lng)
A constraint encodes some resrtictions on values.
problemWith($value)
Tells what the problem with the provided value is.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
foreach($_POST as $key=> $value) $res