1212use Youshido \GraphQL \Type \ListType \ListType ;
1313use Youshido \GraphQL \Type \NonNullType ;
1414use Youshido \GraphQL \Type \Object \ObjectType ;
15+ use Youshido \GraphQL \Type \Scalar \BooleanType ;
16+ use Youshido \GraphQL \Type \Scalar \DateTimeType ;
17+ use Youshido \GraphQL \Type \Scalar \FloatType ;
1518use Youshido \GraphQL \Type \Scalar \IntType ;
1619use Youshido \GraphQL \Type \Scalar \StringType ;
1720use Youshido \GraphQL \Type \TypeInterface ;
@@ -32,25 +35,34 @@ public function testQueryProvider()
3235 $ usersQuery = $ queries [0 ];
3336 $ this ->assertSame ('test ' , $ usersQuery ->getName ());
3437
35- $ this ->assertCount (3 , $ usersQuery ->getArguments ());
38+ $ this ->assertCount (7 , $ usersQuery ->getArguments ());
3639 $ this ->assertInstanceOf (NonNullType::class, $ usersQuery ->getArgument ('int ' )->getType ());
3740 $ this ->assertInstanceOf (IntType::class, $ usersQuery ->getArgument ('int ' )->getType ()->getTypeOf ());
3841 $ this ->assertInstanceOf (StringType::class, $ usersQuery ->getArgument ('string ' )->getType ());
3942 $ this ->assertInstanceOf (NonNullType::class, $ usersQuery ->getArgument ('list ' )->getType ());
4043 $ this ->assertInstanceOf (ListType::class, $ usersQuery ->getArgument ('list ' )->getType ()->getTypeOf ());
4144 $ this ->assertInstanceOf (NonNullType::class, $ usersQuery ->getArgument ('list ' )->getType ()->getTypeOf ()->getItemType ());
4245 $ this ->assertInstanceOf (ObjectType::class, $ usersQuery ->getArgument ('list ' )->getType ()->getTypeOf ()->getItemType ()->getTypeOf ());
46+ $ this ->assertInstanceOf (BooleanType::class, $ usersQuery ->getArgument ('boolean ' )->getType ());
47+ $ this ->assertInstanceOf (FloatType::class, $ usersQuery ->getArgument ('float ' )->getType ());
48+ $ this ->assertInstanceOf (DateTimeType::class, $ usersQuery ->getArgument ('dateTimeImmutable ' )->getType ());
49+ $ this ->assertInstanceOf (DateTimeType::class, $ usersQuery ->getArgument ('dateTime ' )->getType ());
4350 $ this ->assertSame ('TestObject ' , $ usersQuery ->getArgument ('list ' )->getType ()->getTypeOf ()->getItemType ()->getTypeOf ()->getName ());
4451
4552 $ mockResolveInfo = $ this ->createMock (ResolveInfo::class);
4653
4754 $ result = $ usersQuery ->resolve ('foo ' , ['int ' =>42 , 'string ' =>'foo ' , 'list ' =>[
48- ['test ' =>42 ],
49- ['test ' =>12 ],
50- ]], $ mockResolveInfo );
55+ ['test ' =>42 ],
56+ ['test ' =>12 ],
57+ ],
58+ 'boolean ' =>true ,
59+ 'float ' =>4.2 ,
60+ 'dateTimeImmutable ' =>'2017-01-01 01:01:01 ' ,
61+ 'dateTime ' =>'2017-01-01 01:01:01 '
62+ ], $ mockResolveInfo );
5163
5264 $ this ->assertInstanceOf (TestObject::class, $ result );
53- $ this ->assertSame ('foo424212 ' , $ result ->getTest ());
65+ $ this ->assertSame ('foo424212true4.22017010101010120170101010101 ' , $ result ->getTest ());
5466 }
5567
5668 public function testMutations ()
0 commit comments