mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
qa: add test to verify backed enums are no literals
Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
This commit is contained in:
parent
0160c469cd
commit
22bcd576d3
@ -1015,6 +1015,21 @@ class EnumTest extends TestCase
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.1',
|
||||
],
|
||||
'backedEnumDoesNotPassNativeType' => [
|
||||
'code' => '<?php
|
||||
enum State: string
|
||||
{
|
||||
case A = "A";
|
||||
case B = "B";
|
||||
case C = "C";
|
||||
}
|
||||
function f(string $state): void {}
|
||||
f(State::A);
|
||||
',
|
||||
'error_message' => 'InvalidArgument',
|
||||
'ignored_issues' => [],
|
||||
'php_version' => '8.1',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user