3 declare(strict_types=1);
38 $result = $transformation->transform([
'hello' =>
'world']);
40 $this->assertEquals([
'hello' =>
'world'], $result);
45 $this->expectNotToPerformAssertions();
50 $result = $transformation->transform([
'world']);
60 $this->expectNotToPerformAssertions();
65 $result = $transformation->transform([
'hello' => 1]);
75 $this->expectNotToPerformAssertions();
80 $result = $transformation->transform(1);
92 $result = $transformation->applyTo(
new Ok([
'hello' =>
'world']));
94 $this->assertEquals([
'hello' =>
'world'], $result->value());
101 $result = $transformation->applyTo(
new Ok([
'world']));
103 $this->assertTrue($result->isError());
110 $result = $transformation->applyTo(
new Ok([
'hello' => 1]));
112 $this->assertTrue($result->isError());
119 $result = $transformation->applyTo(
new Ok(1));
121 $this->assertTrue($result->isError());
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A result encapsulates a value or an error and simplifies the handling of those.