File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,37 @@ public function testGetSchema(bool $paginationEnabled)
209
209
);
210
210
}
211
211
212
+ /**
213
+ * Tests that the GraphQL SchemaBuilder supports an edge case where a property is typed as an Type::BUILTIN_TYPE_OBJECT but has no class related.
214
+ */
215
+ public function testObjectTypeWithoutClass ()
216
+ {
217
+ $ propertyMetadataMockBuilder = function ($ builtinType , $ resourceClassName ) {
218
+ return new PropertyMetadata (
219
+ new Type (
220
+ $ builtinType
221
+ ),
222
+ "{$ builtinType }Description " ,
223
+ true ,
224
+ true ,
225
+ null ,
226
+ null ,
227
+ null
228
+ );
229
+ };
230
+
231
+ $ mockedSchemaBuilder = $ this ->createSchemaBuilder ($ propertyMetadataMockBuilder , false );
232
+ $ this ->assertEquals ([
233
+ 'node ' ,
234
+ 'shortName1 ' ,
235
+ 'shortName1s ' ,
236
+ 'shortName2 ' ,
237
+ 'shortName2s ' ,
238
+ 'shortName3 ' ,
239
+ 'shortName3s ' ,
240
+ ], array_keys ($ mockedSchemaBuilder ->getSchema ()->getConfig ()->getQuery ()->getFields ()));
241
+ }
242
+
212
243
public function paginationProvider (): array
213
244
{
214
245
return [
You can’t perform that action at this time.
0 commit comments