Skip to content

Commit

Permalink
Add test cases for enum crash
Browse files Browse the repository at this point in the history
  • Loading branch information
AegirLeet committed Feb 2, 2024
1 parent 8b754be commit 5cdf3b7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/EnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,42 @@ enum Bar: int
'ignored_issues' => [],
'php_version' => '8.1',
],
'stringBackedEnumCaseValueFromStringBackedEnumCaseValue' => [
'code' => <<<'PHP'
<?php
enum Foo: string
{
case Bar = 'bar';
}
enum Baz: string
{
case Qux = Foo::Bar->value;
}
PHP,
'assertions' => [],
'ignored_issues' => [],
'php_version' => '8.1',
],
'intBackedEnumCaseValueFromIntBackedEnumCaseValue' => [
'code' => <<<'PHP'
<?php
enum Foo: int
{
case Bar = 123;
}
enum Baz: int
{
case Qux = Foo::Bar->value;
}
PHP,
'assertions' => [],
'ignored_issues' => [],
'php_version' => '8.1',
],
];
}

Expand Down

0 comments on commit 5cdf3b7

Please sign in to comment.