19 declare(strict_types=1);
38 $result = $listTransformation->transform([
'hello',
'world']);
40 $this->assertEquals([
'hello',
'world'], $result);
46 $this->assertSame([], $listTransformation->transform([]));
52 $result = $listTransformation->applyTo(
new Ok([]));
53 $this->assertFalse($result->isError());
58 $this->expectNotToPerformAssertions();
62 $result = $listTransformation->transform(
null);
73 $result = $listTransformation->applyTo(
new Ok(
null));
74 $this->assertTrue($result->isError());
80 $this->expectNotToPerformAssertions();
85 $result = $listTransformation->transform([
'hello', 2]);
97 $result = $listTransformation->applyTo(
new Ok([
'hello',
'world']));
99 $this->assertEquals([
'hello',
'world'], $result->value());
100 $this->assertTrue($result->isOK());
107 $result = $listTransformation->applyTo(
new Ok([
'hello', 2]));
109 $this->assertTrue($result->isError());
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
A result encapsulates a value or an error and simplifies the handling of those.