We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 369b5b0 commit d2d4c81Copy full SHA for d2d4c81
2 files changed
src/TypeSystem/Type/EnumType/EnumType.php
@@ -40,6 +40,6 @@ enumName: $enumDeclarationNode->enumName
40
41
public function is(TypeInterface $other): bool
42
{
43
- return false;
+ return $other === $this;
44
}
45
test/Unit/TypeSystem/Type/EnumType/EnumTypeTest.php
@@ -57,4 +57,20 @@ public function providesNameOfTheEnum(): void
57
58
$this->assertEquals('SomeEnum', $enumType->enumName);
59
60
+
61
+ /**
62
+ * @test
63
+ * @return void
64
+ */
65
+ public function isEquivalentToItself(): void
66
+ {
67
+ $enumDeclarationNode = EnumDeclarationNode::fromString(
68
+ 'enum SomeEnum {}'
69
+ );
70
+ $enumType = EnumType::fromEnumDeclarationNode(
71
+ $enumDeclarationNode
72
73
74
+ $this->assertTrue($enumType->is($enumType));
75
+ }
76
0 commit comments