File tree Expand file tree Collapse file tree
src/TypeSystem/Type/ComponentType
test/Unit/TypeSystem/Type/ComponentType Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,6 @@ public static function fromComponentDeclarationNode(ComponentDeclarationNode $co
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 @@ -59,4 +59,20 @@ public function providesNameOfTheComponent(): void
5959
6060 $ this ->assertEquals ('SomeComponent ' , $ componentType ->componentName );
6161 }
62+
63+ /**
64+ * @test
65+ * @return void
66+ */
67+ public function isEquivalentToItself (): void
68+ {
69+ $ componentDeclarationNode = ComponentDeclarationNode::fromString (
70+ 'component SomeComponent { return "" } '
71+ );
72+ $ componentType = ComponentType::fromComponentDeclarationNode (
73+ $ componentDeclarationNode
74+ );
75+
76+ $ this ->assertTrue ($ componentType ->is ($ componentType ));
77+ }
6278}
You can’t perform that action at this time.
0 commit comments