File tree Expand file tree Collapse file tree
src/TypeSystem/Type/StructType
test/Unit/TypeSystem/Type/StructType Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,6 @@ public static function fromStructDeclarationNode(StructDeclarationNode $structDe
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 providesNameOfTheStruct(): void
5757
5858 $ this ->assertEquals ('SomeStruct ' , $ structStaticType ->structName );
5959 }
60+
61+ /**
62+ * @test
63+ * @return void
64+ */
65+ public function isEquivalentToItself (): void
66+ {
67+ $ structDeclarationNode = StructDeclarationNode::fromString (
68+ 'struct SomeStruct {} '
69+ );
70+ $ structStaticType = StructType::fromStructDeclarationNode (
71+ $ structDeclarationNode
72+ );
73+
74+ $ this ->assertTrue ($ structStaticType ->is ($ structStaticType ));
75+ }
6076}
You can’t perform that action at this time.
0 commit comments