File tree Expand file tree Collapse file tree
src/TypeSystem/Type/EnumType
test/Unit/TypeSystem/Type/EnumType Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,6 @@ enumName: $enumDeclarationNode->enumName
4040
4141 public function is (TypeInterface $ other ): bool
4242 {
43- return false ;
43+ return $ other === $ this ;
4444 }
4545}
Original file line number Diff line number Diff line change @@ -57,4 +57,20 @@ public function providesNameOfTheEnum(): void
5757
5858 $ this ->assertEquals ('SomeEnum ' , $ enumStaticType ->enumName );
5959 }
60+
61+ /**
62+ * @test
63+ * @return void
64+ */
65+ public function isEquivalentToItself (): void
66+ {
67+ $ enumDeclarationNode = EnumDeclarationNode::fromString (
68+ 'enum SomeEnum {} '
69+ );
70+ $ enumStaticType = EnumStaticType::fromEnumDeclarationNode (
71+ $ enumDeclarationNode
72+ );
73+
74+ $ this ->assertTrue ($ enumStaticType ->is ($ enumStaticType ));
75+ }
6076}
You can’t perform that action at this time.
0 commit comments