@@ -95,6 +95,32 @@ public function testGetSchemaResourceClassNotFound()
95
95
$ this ->assertArrayNotHasKey ('objectProperty ' , $ type ->getFields ());
96
96
}
97
97
98
+ public function testConvertFilterArgsToTypes ()
99
+ {
100
+ $ propertyMetadataMockBuilder = function ($ builtinType , $ resourceClassName ) {
101
+ return new PropertyMetadata ();
102
+ };
103
+ $ mockedSchemaBuilder = $ this ->createSchemaBuilder ($ propertyMetadataMockBuilder , false );
104
+
105
+ $ reflectionClass = new \ReflectionClass (SchemaBuilder::class);
106
+ $ method = $ reflectionClass ->getMethod ('convertFilterArgsToTypes ' );
107
+ $ method ->setAccessible (true );
108
+ $ filterArgs = [
109
+ 'aField ' => 'string ' ,
110
+ 'GraphqlRelatedResource.nestedFieldA ' => 'string ' ,
111
+ 'GraphqlRelatedResource.nestedFieldB ' => 'string ' ,
112
+ ];
113
+
114
+ $ this ->assertSame (
115
+ [
116
+ 'aField ' => 'string ' ,
117
+ 'GraphqlRelatedResource_nestedFieldA ' => 'string ' ,
118
+ 'GraphqlRelatedResource_nestedFieldB ' => 'string ' ,
119
+ ],
120
+ $ method ->invoke ($ mockedSchemaBuilder , $ filterArgs )
121
+ );
122
+ }
123
+
98
124
/**
99
125
* @dataProvider paginationProvider
100
126
*/
@@ -230,8 +256,10 @@ private function createSchemaBuilder($propertyMetadataMockBuilder, bool $paginat
230
256
$ resourceNameCollection = new ResourceNameCollection ($ resourceClassNames );
231
257
$ resourceNameCollectionFactoryProphecy ->create ()->willReturn ($ resourceNameCollection );
232
258
233
- $ collectionResolverFactoryProphecy ->__invoke (Argument::cetera ())->willReturn (function () {});
234
- $ itemMutationResolverFactoryProphecy ->__invoke (Argument::cetera ())->willReturn (function () {});
259
+ $ collectionResolverFactoryProphecy ->__invoke (Argument::cetera ())->willReturn (function () {
260
+ });
261
+ $ itemMutationResolverFactoryProphecy ->__invoke (Argument::cetera ())->willReturn (function () {
262
+ });
235
263
236
264
return new SchemaBuilder (
237
265
$ propertyNameCollectionFactoryProphecy ->reveal (),
@@ -240,8 +268,10 @@ private function createSchemaBuilder($propertyMetadataMockBuilder, bool $paginat
240
268
$ resourceMetadataFactoryProphecy ->reveal (),
241
269
$ collectionResolverFactoryProphecy ->reveal (),
242
270
$ itemMutationResolverFactoryProphecy ->reveal (),
243
- function () {},
244
- function () {},
271
+ function () {
272
+ },
273
+ function () {
274
+ },
245
275
null ,
246
276
$ paginationEnabled
247
277
);
0 commit comments