3declare(strict_types=1);
27use ILIAS\Refinery\IsArrayOfSameType;
29use UnexpectedValueException;
42 $result = $transformation->transform([1, 2]);
44 $this->assertEquals([1, 2], $result);
49 $this->expectNotToPerformAssertions();
56 $result = $transformation->transform([1, 2]);
57 }
catch (UnexpectedValueException $exception) {
66 $this->expectNotToPerformAssertions();
73 $result = $transformation->transform([1, 2]);
74 }
catch (UnexpectedValueException $exception) {
84 $this->expectNotToPerformAssertions();
91 $result = $transformation->transform([1, 2, 3]);
92 }
catch (UnexpectedValueException $exception) {
104 $result = $transformation->applyTo(
new Result\
Ok([1, 2]));
106 $this->assertEquals([1, 2], $result->value());
115 $result = $transformation->applyTo(
new Result\
Ok([1, 2]));
117 $this->assertTrue($result->isError());
126 $result = $transformation->applyTo(
new Result\
Ok([1, 2, 3]));
128 $this->assertTrue($result->isError());
133 $this->expectNotToPerformAssertions();
139 }
catch (UnexpectedValueException $exception) {
A result encapsulates a value or an error and simplifies the handling of those.
A result encapsulates a value or an error and simplifies the handling of those.