Skip to content

Commit 11a7eb9

Browse files
Add non regression test
1 parent 5adafcb commit 11a7eb9

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tests/PHPStan/Rules/Classes/EnumSanityRuleTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,15 @@ public function testBug13768(): void
179179
]);
180180
}
181181

182+
#[RequiresPhp('>= 8.1')]
183+
public function testBug11891(): void
184+
{
185+
$this->analyse([__DIR__ . '/data/bug-11891.php'], [
186+
[
187+
'Enum test has duplicate value 42 for cases A, B.',
188+
3,
189+
],
190+
]);
191+
}
192+
182193
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php // lint >= 8.1
2+
3+
namespace Bug11891;
4+
5+
enum test:int {
6+
case A = 42;
7+
case B = self::A->value;
8+
};

0 commit comments

Comments
 (0)