19declare(strict_types=1);
27use PHPUnit\Framework\TestCase;
28use UnexpectedValueException;
41 $result = $transformation->transform([1, 2]);
43 $this->assertEquals([1, 2], $result);
48 $this->expectNotToPerformAssertions();
55 $result = $transformation->transform([1, 2]);
56 }
catch (UnexpectedValueException $exception) {
65 $this->expectNotToPerformAssertions();
72 $result = $transformation->transform([1, 2]);
73 }
catch (UnexpectedValueException $exception) {
83 $this->expectNotToPerformAssertions();
90 $result = $transformation->transform([1, 2, 3]);
91 }
catch (UnexpectedValueException $exception) {
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();
138 }
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.