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
7373 );
7474 }
7575
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+
7688 public function testFailureWhenAdderFunctionParamIsNotVariadic (): void
7789 {
7890 $ 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