Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
orklah committed Feb 13, 2022
1 parent 5f1b796 commit aaf34d7
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/EnumTest.php
Expand Up @@ -405,6 +405,35 @@ function foo(): int|Code|null
'ignored_issues' => [],
'php_version' => '8.1',
],
'EnumCaseReconciliation' => [
'code' => '<?php
enum Code: int
{
case Ok = 0;
case Fatal = 1;
}
function foo(): Code|null
{
return null;
}
$code = foo();
$code1 = null;
$code2 = null;
if($code instanceof Code){
$code1 = $code;
}
if(!$code instanceof Code){
$code2 = $code;
}',
'assertions' => [
'$code1' => 'Code|null',
'$code2' => 'null',
],
'ignored_issues' => [],
'php_version' => '8.1',
],
];
}

Expand Down

0 comments on commit aaf34d7

Please sign in to comment.