Skip to content

Commit

Permalink
Adds failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 27, 2021
1 parent 2f4d826 commit 3472e69
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/ReflectionClosurePhp80Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
expect($f1)->toBeCode($e1);
});

test('null safe operator', function () {
test('null safe operator with methods', function () {
$f1 = function () {
$obj = new \stdClass();

Expand All @@ -52,6 +52,21 @@
expect($f1)->toBeCode($e1);
});

test('null safe operator with properties', function () {
$f1 = function () {
$obj = new \stdClass();

return $obj?->invalid;
};
$e1 = 'function () {
$obj = new \stdClass();
return $obj?->invalid;
}';

expect($f1)->toBeCode($e1);
});

test('trailling comma', function () {
$f1 = function (string $param, ) {
};
Expand Down

0 comments on commit 3472e69

Please sign in to comment.