File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
solutions/unite-the-types Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,18 @@ public function testFailureWhenAdderFunctionHasIncorrectUnion(): void
73
73
);
74
74
}
75
75
76
+ public function testFailureWhenAdderFunctionHasCorrectUnionWithExtraTypes (): void
77
+ {
78
+ $ this ->runExercise ('incorrect-union-extra-type.php ' );
79
+
80
+ $ this ->assertVerifyWasNotSuccessful ();
81
+
82
+ $ this ->assertResultsHasFailure (
83
+ Failure::class,
84
+ 'Union type is incorrect, it should only accept the required types '
85
+ );
86
+ }
87
+
76
88
public function testFailureWhenAdderFunctionParamIsNotVariadic (): void
77
89
{
78
90
$ this ->runExercise ('union-type-param-not-variadic.php ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ function adder (int |float |string |bool $ numbers ) {
4
+ }
You can’t perform that action at this time.
0 commit comments