17 require_once(
'./libs/composer/vendor/autoload.php');
36 $result = $transformation->transform(array(
'hello', 42));
38 $this->assertEquals(array(
'hello', 42),
$result);
43 $this->expectNotToPerformAssertions();
48 $object = $transformation->transform(array(
'hello',
'world'));
49 }
catch (\TypeError $exception) {
58 $this->expectNotToPerformAssertions();
62 }
catch (\
Error $exception) {
71 $this->expectNotToPerformAssertions();
84 $this->expectNotToPerformAssertions();
89 $object = $transformation->transform(array(
'hello', 10));
90 }
catch (\
Error $error) {
99 $this->expectNotToPerformAssertions();
103 $object = $transformation->applyTo(
new Ok(array(
'hello', 10)));
104 }
catch (\
Error $error) {
113 $this->expectNotToPerformAssertions();
118 $object = $transformation->transform(array(
'hello', 10));
130 $object = $transformation->applyTo(
new Ok(array(
'hello', 10)));
132 $this->assertTrue($object->isError());
138 public function myMethod(
string $string,
int $integer)
140 return array($string, $integer);
145 return array($string, $integer);
150 throw new \Exception(
'SomeException');
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.