19 declare(strict_types=1);
41 $result = $transformation->transform([1, 2]);
43 $this->assertEquals([1, 2], $result);
48 $this->expectNotToPerformAssertions();
55 $result = $transformation->transform([1, 2]);
65 $this->expectNotToPerformAssertions();
72 $result = $transformation->transform([1, 2]);
83 $this->expectNotToPerformAssertions();
90 $result = $transformation->transform([1, 2, 3]);
103 $result = $transformation->applyTo(
new Result\
Ok([1, 2]));
105 $this->assertEquals([1, 2], $result->value());
114 $result = $transformation->applyTo(
new Result\
Ok([1, 2]));
116 $this->assertTrue($result->isError());
125 $result = $transformation->applyTo(
new Result\
Ok([1, 2, 3]));
127 $this->assertTrue($result->isError());
132 $this->expectNotToPerformAssertions();
A result encapsulates a value or an error and simplifies the handling of those.