1212use Symfony \Component \Cache \Simple \ArrayCache ;
1313use TheCodingMachine \GraphQLite \AbstractQueryProviderTest ;
1414use TheCodingMachine \GraphQLite \Annotations \HideParameter ;
15- use TheCodingMachine \GraphQLite \Fixtures \TestObject ;
16- use TheCodingMachine \GraphQLite \Fixtures \TestObject2 ;
15+ use TheCodingMachine \GraphQLite \Fixtures80 \UnionOutputType ;
1716use TheCodingMachine \GraphQLite \Mappers \CannotMapTypeException ;
1817use TheCodingMachine \GraphQLite \Mappers \Root \BaseTypeMapper ;
1918use TheCodingMachine \GraphQLite \Mappers \Root \CompositeRootTypeMapper ;
@@ -38,13 +37,16 @@ public function testMapScalarUnionException(): void
3837 $ typeMapper ->mapReturnType ($ refMethod , $ docBlockObj );
3938 }
4039
40+ /**
41+ * @requires PHP >= 8.0
42+ */
4143 public function testMapObjectUnionWorks (): void
4244 {
4345 $ typeMapper = new TypeHandler ($ this ->getArgumentResolver (), $ this ->getRootTypeMapper (), $ this ->getTypeResolver ());
4446
4547 $ cachedDocBlockFactory = new CachedDocBlockFactory (new Psr16Cache (new ArrayAdapter ()));
4648
47- $ refMethod = new ReflectionMethod ($ this , 'objectUnion ' );
49+ $ refMethod = new ReflectionMethod (UnionOutputType::class , 'objectUnion ' );
4850 $ docBlockObj = $ cachedDocBlockFactory ->getDocBlock ($ refMethod );
4951
5052 $ gqType = $ typeMapper ->mapReturnType ($ refMethod , $ docBlockObj );
@@ -101,10 +103,6 @@ private function dummy() {
101103
102104 }
103105
104- private function objectUnion (): TestObject |TestObject2 {
105- return new TestObject (('' ));
106- }
107-
108106 /**
109107 * @HideParameter(for="$foo")
110108 */
0 commit comments