1414use Mouf \Picotainer \Picotainer ;
1515use Psr \Container \ContainerInterface ;
1616use Symfony \Component \Cache \Simple \NullCache ;
17- use TheCodingMachine \GraphQL \ Controllers \AnnotationReader ;
17+ use TheCodingMachine \GraphQLite \AnnotationReader ;
1818use Doctrine \Common \Annotations \AnnotationReader as DoctrineAnnotationReader ;
19- use TheCodingMachine \GraphQL \Controllers \Containers \BasicAutoWiringContainer ;
20- use TheCodingMachine \GraphQL \Controllers \FieldsBuilderFactory ;
21- use TheCodingMachine \GraphQL \Controllers \Hydrators \FactoryHydrator ;
22- use TheCodingMachine \GraphQL \Controllers \Hydrators \HydratorInterface ;
23- use TheCodingMachine \GraphQL \Controllers \InputTypeGenerator ;
24- use TheCodingMachine \GraphQL \Controllers \InputTypeUtils ;
25- use TheCodingMachine \GraphQL \Controllers \Mappers \GlobTypeMapper ;
26- use TheCodingMachine \GraphQL \Controllers \Mappers \RecursiveTypeMapper ;
27- use TheCodingMachine \GraphQL \Controllers \Mappers \RecursiveTypeMapperInterface ;
28- use TheCodingMachine \GraphQL \Controllers \Mappers \TypeMapperInterface ;
29- use TheCodingMachine \GraphQL \Controllers \NamingStrategy ;
30- use TheCodingMachine \GraphQL \Controllers \Reflection \CachedDocBlockFactory ;
31- use TheCodingMachine \GraphQL \Controllers \Security \AuthenticationServiceInterface ;
32- use TheCodingMachine \GraphQL \Controllers \Security \AuthorizationServiceInterface ;
33- use TheCodingMachine \GraphQL \Controllers \Security \VoidAuthenticationService ;
34- use TheCodingMachine \GraphQL \Controllers \Security \VoidAuthorizationService ;
35- use TheCodingMachine \GraphQL \Controllers \TypeGenerator ;
36- use TheCodingMachine \GraphQL \Controllers \Types \TypeResolver ;
19+ use TheCodingMachine \GraphQLite \Containers \BasicAutoWiringContainer ;
20+ use TheCodingMachine \GraphQLite \FieldsBuilderFactory ;
21+ use TheCodingMachine \GraphQLite \Hydrators \FactoryHydrator ;
22+ use TheCodingMachine \GraphQLite \Hydrators \HydratorInterface ;
23+ use TheCodingMachine \GraphQLite \InputTypeGenerator ;
24+ use TheCodingMachine \GraphQLite \InputTypeUtils ;
25+ use TheCodingMachine \GraphQLite \Mappers \GlobTypeMapper ;
26+ use TheCodingMachine \GraphQLite \Mappers \RecursiveTypeMapper ;
27+ use TheCodingMachine \GraphQLite \Mappers \RecursiveTypeMapperInterface ;
28+ use TheCodingMachine \GraphQLite \Mappers \TypeMapperInterface ;
29+ use TheCodingMachine \GraphQLite \NamingStrategy ;
30+ use TheCodingMachine \GraphQLite \Reflection \CachedDocBlockFactory ;
31+ use TheCodingMachine \GraphQLite \Security \AuthenticationServiceInterface ;
32+ use TheCodingMachine \GraphQLite \Security \AuthorizationServiceInterface ;
33+ use TheCodingMachine \GraphQLite \Security \VoidAuthenticationService ;
34+ use TheCodingMachine \GraphQLite \Security \VoidAuthorizationService ;
35+ use TheCodingMachine \GraphQLite \TypeGenerator ;
36+ use TheCodingMachine \GraphQLite \TypeRegistry ;
37+ use TheCodingMachine \GraphQLite \Types \TypeResolver ;
3738use TheCodingMachine \TDBM \Configuration ;
3839use TheCodingMachine \Tdbm \GraphQL \Registry \EmptyContainer ;
3940use TheCodingMachine \Tdbm \GraphQL \Tests \Beans \Country ;
4344use TheCodingMachine \Tdbm \GraphQL \Tests \GraphQL \CountryType ;
4445use TheCodingMachine \Tdbm \GraphQL \Tests \GraphQL \Generated \AbstractCountryType ;
4546use TheCodingMachine \Tdbm \GraphQL \Tests \GraphQL \Generated \AbstractUserType ;
46- use TheCodingMachine \Tdbm \GraphQL \Tests \GraphQL \TdbmGraphQLTypeMapper ;
4747use TheCodingMachine \Tdbm \GraphQL \Tests \GraphQL \UserType ;
4848use TheCodingMachine \TDBM \TDBMService ;
4949use TheCodingMachine \TDBM \Utils \DefaultNamingStrategy as TdbmDefaultNamingStrategy ;
5050use PHPUnit \Framework \TestCase ;
51- use Youshido \GraphQL \Execution \Context \ExecutionContext ;
52- use Youshido \GraphQL \Execution \Processor ;
53- use Youshido \GraphQL \Execution \ResolveInfo ;
5451use GraphQL \Type \Schema ;
55- use Youshido \GraphQL \Type \Scalar \StringType ;
5652
5753class GraphQLTypeGeneratorTest extends TestCase
5854{
@@ -71,7 +67,8 @@ public function setUp()
7167 $ container ->get (AuthenticationServiceInterface::class),
7268 $ container ->get (AuthorizationServiceInterface::class),
7369 $ container ->get (TypeResolver::class),
74- $ container ->get (CachedDocBlockFactory::class)
70+ $ container ->get (CachedDocBlockFactory::class),
71+ $ container ->get (NamingStrategyInterface::class)
7572 );
7673 },
7774 BasicAutoWiringContainer::class => function (ContainerInterface $ container ) {
@@ -84,7 +81,11 @@ public function setUp()
8481 return new VoidAuthenticationService ();
8582 },
8683 RecursiveTypeMapperInterface::class => function (ContainerInterface $ container ) {
87- return new RecursiveTypeMapper ($ container ->get (TypeMapperInterface::class), $ container ->get (NamingStrategyInterface::class), new \Symfony \Component \Cache \Simple \ArrayCache ());
84+ return new RecursiveTypeMapper (
85+ $ container ->get (TypeMapperInterface::class),
86+ $ container ->get (NamingStrategyInterface::class),
87+ new \Symfony \Component \Cache \Simple \ArrayCache (),
88+ $ container ->get (TypeRegistry::class));
8889 },
8990 TypeMapperInterface::class => function (ContainerInterface $ container ) {
9091 return new GlobTypeMapper (
@@ -102,9 +103,14 @@ public function setUp()
102103 return new TypeGenerator (
103104 $ container ->get (AnnotationReader::class),
104105 $ container ->get (FieldsBuilderFactory::class),
105- $ container ->get (NamingStrategyInterface::class)
106+ $ container ->get (NamingStrategyInterface::class),
107+ $ container ->get (TypeRegistry::class),
108+ $ container ->get (BasicAutoWiringContainer::class)
106109 );
107110 },
111+ TypeRegistry::class => function () {
112+ return new TypeRegistry ();
113+ },
108114 AnnotationReader::class => function (ContainerInterface $ container ) {
109115 return new AnnotationReader (new DoctrineAnnotationReader ());
110116 },
@@ -223,7 +229,7 @@ public function testQuery()
223229 'name ' => 'Query ' ,
224230 'fields ' => [
225231 'users ' => [
226- 'type ' => Type::listOf ($ this ->mainContainer ->get (RecursiveTypeMapperInterface::class)->mapClassToType (User::class)),
232+ 'type ' => Type::listOf ($ this ->mainContainer ->get (RecursiveTypeMapperInterface::class)->mapClassToType (User::class, null )),
227233 'resolve ' => function () use ($ userDao ) {
228234 return $ userDao ->findAll ();
229235 }
@@ -319,7 +325,7 @@ private function recursiveDelete(string $str) : bool
319325
320326 public function testResultIteratorType ()
321327 {
322- $ type = new ResultIteratorType ($ this ->mainContainer ->get (RecursiveTypeMapperInterface::class)->mapClassToType (Country::class));
328+ $ type = new ResultIteratorType ($ this ->mainContainer ->get (RecursiveTypeMapperInterface::class)->mapClassToType (Country::class, null ));
323329
324330 $ tdbmService = self ::getTDBMService ();
325331 $ countryDao = new CountryDao ($ tdbmService );
0 commit comments