File tree Expand file tree Collapse file tree
test/Unit/TypeSystem/Type/UnionType Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222
2323namespace PackageFactory \ComponentEngine \Test \Unit \TypeSystem \Type \UnionType ;
2424
25+ use PackageFactory \ComponentEngine \TypeSystem \Type \BooleanType \BooleanType ;
2526use PackageFactory \ComponentEngine \TypeSystem \Type \NumberType \NumberType ;
2627use PackageFactory \ComponentEngine \TypeSystem \Type \StringType \StringType ;
2728use PackageFactory \ComponentEngine \TypeSystem \Type \UnionType \UnionType ;
@@ -90,11 +91,22 @@ public function isReturnsTrueIfGivenTypeIsCongruentUnionTypeWithRedundantMembers
9091 /**
9192 * @test
9293 */
93- public function isReturnsFalseIfGivenTypeIsNotCongruent (): void
94+ public function isReturnsFalseIfGivenTypeIsNotAUnionType (): void
9495 {
9596 $ unionType = UnionType::of (StringType::get (), NumberType::get ());
9697
9798 $ this ->assertFalse ($ unionType ->is (NumberType::get ()));
9899 $ this ->assertFalse ($ unionType ->is (StringType::get ()));
99100 }
100- }
101+
102+ /**
103+ * @test
104+ */
105+ public function isReturnsFalseIfGivenTypeIsANonCongruentUnionType (): void
106+ {
107+ $ unionType = UnionType::of (StringType::get (), NumberType::get ());
108+ $ otherUnionType = UnionType::of (StringType::get (), BooleanType::get ());
109+
110+ $ this ->assertFalse ($ unionType ->is ($ otherUnionType ));
111+ }
112+ }
You can’t perform that action at this time.
0 commit comments