mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
add test
This commit is contained in:
parent
954884eb48
commit
9cc82d55f7
@ -382,6 +382,29 @@ class EnumTest extends TestCase
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.1',
|
||||
],
|
||||
'EnumCollapsing' => [
|
||||
'code' => '<?php
|
||||
enum Code: int
|
||||
{
|
||||
case Ok = 0;
|
||||
case Fatal = 1;
|
||||
}
|
||||
|
||||
function foo(): int|Code|null
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$code = foo();
|
||||
if(!isset($code)){
|
||||
$code = Code::Ok;
|
||||
}',
|
||||
'assertions' => [
|
||||
'$code' => 'Code|int',
|
||||
],
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.1',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user