Skip to content

Commit f409b6c

Browse files
Add test
1 parent bec0a6f commit f409b6c

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php // lint >= 8.0
2+
3+
namespace Bug4890Php8;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
enum MyEnum
8+
{
9+
case CASE1;
10+
case CASE2;
11+
12+
public function someMethod(): bool { return true; }
13+
}
14+
15+
class HelloWorld
16+
{
17+
public function withEnumCase(\UnitEnum $entity): void
18+
{
19+
assertType('class-string<UnitEnum>', get_class($entity));
20+
assert(method_exists($entity, 'someMethod'));
21+
assertType('class-string<UnitEnum&hasMethod(someMethod)>', get_class($entity));
22+
}
23+
}

0 commit comments

Comments
 (0)