Conditions | 1 |
Paths | 1 |
Total Lines | 1047 |
Code Lines | 826 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
23 | function testExecutesAnIntrospectionQuery() |
||
|
|||
24 | { |
||
25 | $emptySchema = new Schema([ |
||
26 | 'query' => new ObjectType([ |
||
27 | 'name' => 'QueryRoot', |
||
28 | 'fields' => ['a' => Type::string()] |
||
29 | ]) |
||
30 | ]); |
||
31 | |||
32 | $request = Introspection::getIntrospectionQuery(['descriptions' => false]); |
||
33 | $expected = array ( |
||
34 | 'data' => |
||
35 | array ( |
||
36 | '__schema' => |
||
37 | array ( |
||
38 | 'mutationType' => NULL, |
||
39 | 'subscriptionType' => NULL, |
||
40 | 'queryType' => |
||
41 | array ( |
||
42 | 'name' => 'QueryRoot', |
||
43 | ), |
||
44 | 'types' => |
||
45 | array ( |
||
46 | array ( |
||
47 | 'kind' => 'OBJECT', |
||
48 | 'name' => 'QueryRoot', |
||
49 | 'inputFields' => NULL, |
||
50 | 'interfaces' => |
||
51 | array ( |
||
52 | ), |
||
53 | 'enumValues' => NULL, |
||
54 | 'possibleTypes' => NULL, |
||
55 | 'fields' => array ( |
||
56 | array ( |
||
57 | 'name' => 'a', |
||
58 | 'args' => array(), |
||
59 | 'type' => array( |
||
60 | 'kind' => 'SCALAR', |
||
61 | 'name' => 'String', |
||
62 | 'ofType' => null |
||
63 | ), |
||
64 | 'isDeprecated' => false, |
||
65 | 'deprecationReason' => null, |
||
66 | ) |
||
67 | ) |
||
68 | ), |
||
69 | array ( |
||
70 | 'kind' => 'SCALAR', |
||
71 | 'name' => 'String', |
||
72 | 'fields' => NULL, |
||
73 | 'inputFields' => NULL, |
||
74 | 'interfaces' => NULL, |
||
75 | 'enumValues' => NULL, |
||
76 | 'possibleTypes' => NULL, |
||
77 | ), |
||
78 | array ( |
||
79 | 'kind' => 'SCALAR', |
||
80 | 'name' => 'ID', |
||
81 | 'fields' => NULL, |
||
82 | 'inputFields' => NULL, |
||
83 | 'interfaces' => NULL, |
||
84 | 'enumValues' => NULL, |
||
85 | 'possibleTypes' => NULL, |
||
86 | ), |
||
87 | array ( |
||
88 | 'kind' => 'SCALAR', |
||
89 | 'name' => 'Float', |
||
90 | 'fields' => NULL, |
||
91 | 'inputFields' => NULL, |
||
92 | 'interfaces' => NULL, |
||
93 | 'enumValues' => NULL, |
||
94 | 'possibleTypes' => NULL, |
||
95 | ), |
||
96 | array ( |
||
97 | 'kind' => 'SCALAR', |
||
98 | 'name' => 'Int', |
||
99 | 'fields' => NULL, |
||
100 | 'inputFields' => NULL, |
||
101 | 'interfaces' => NULL, |
||
102 | 'enumValues' => NULL, |
||
103 | 'possibleTypes' => NULL, |
||
104 | ), |
||
105 | array ( |
||
106 | 'kind' => 'SCALAR', |
||
107 | 'name' => 'Boolean', |
||
108 | 'fields' => NULL, |
||
109 | 'inputFields' => NULL, |
||
110 | 'interfaces' => NULL, |
||
111 | 'enumValues' => NULL, |
||
112 | 'possibleTypes' => NULL, |
||
113 | ), |
||
114 | array ( |
||
115 | 'kind' => 'OBJECT', |
||
116 | 'name' => '__Schema', |
||
117 | 'fields' => |
||
118 | array ( |
||
119 | 0 => |
||
120 | array ( |
||
121 | 'name' => 'types', |
||
122 | 'args' => |
||
123 | array ( |
||
124 | ), |
||
125 | 'type' => |
||
126 | array ( |
||
127 | 'kind' => 'NON_NULL', |
||
128 | 'name' => NULL, |
||
129 | 'ofType' => |
||
130 | array ( |
||
131 | 'kind' => 'LIST', |
||
132 | 'name' => NULL, |
||
133 | 'ofType' => |
||
134 | array ( |
||
135 | 'kind' => 'NON_NULL', |
||
136 | 'name' => NULL, |
||
137 | 'ofType' => |
||
138 | array ( |
||
139 | 'kind' => 'OBJECT', |
||
140 | 'name' => '__Type' |
||
141 | ), |
||
142 | ), |
||
143 | ), |
||
144 | ), |
||
145 | 'isDeprecated' => false, |
||
146 | 'deprecationReason' => NULL, |
||
147 | ), |
||
148 | 1 => |
||
149 | array ( |
||
150 | 'name' => 'queryType', |
||
151 | 'args' => |
||
152 | array ( |
||
153 | ), |
||
154 | 'type' => |
||
155 | array ( |
||
156 | 'kind' => 'NON_NULL', |
||
157 | 'name' => NULL, |
||
158 | 'ofType' => |
||
159 | array ( |
||
160 | 'kind' => 'OBJECT', |
||
161 | 'name' => '__Type', |
||
162 | ), |
||
163 | ), |
||
164 | 'isDeprecated' => false, |
||
165 | 'deprecationReason' => NULL, |
||
166 | ), |
||
167 | array ( |
||
168 | 'name' => 'mutationType', |
||
169 | 'args' => |
||
170 | array ( |
||
171 | ), |
||
172 | 'type' => |
||
173 | array ( |
||
174 | 'kind' => 'OBJECT', |
||
175 | 'name' => '__Type', |
||
176 | ), |
||
177 | 'isDeprecated' => false, |
||
178 | 'deprecationReason' => NULL, |
||
179 | ), |
||
180 | array ( |
||
181 | 'name' => 'subscriptionType', |
||
182 | 'args' => |
||
183 | array ( |
||
184 | ), |
||
185 | 'type' => |
||
186 | array ( |
||
187 | 'kind' => 'OBJECT', |
||
188 | 'name' => '__Type', |
||
189 | ), |
||
190 | 'isDeprecated' => false, |
||
191 | 'deprecationReason' => NULL, |
||
192 | ), |
||
193 | array ( |
||
194 | 'name' => 'directives', |
||
195 | 'args' => |
||
196 | array ( |
||
197 | ), |
||
198 | 'type' => |
||
199 | array ( |
||
200 | 'kind' => 'NON_NULL', |
||
201 | 'name' => NULL, |
||
202 | 'ofType' => |
||
203 | array ( |
||
204 | 'kind' => 'LIST', |
||
205 | 'name' => NULL, |
||
206 | 'ofType' => |
||
207 | array ( |
||
208 | 'kind' => 'NON_NULL', |
||
209 | 'name' => NULL, |
||
210 | 'ofType' => |
||
211 | array ( |
||
212 | 'kind' => 'OBJECT', |
||
213 | 'name' => '__Directive', |
||
214 | ), |
||
215 | ), |
||
216 | ), |
||
217 | ), |
||
218 | 'isDeprecated' => false, |
||
219 | 'deprecationReason' => NULL, |
||
220 | ), |
||
221 | ), |
||
222 | 'inputFields' => NULL, |
||
223 | 'interfaces' => |
||
224 | array ( |
||
225 | ), |
||
226 | 'enumValues' => NULL, |
||
227 | 'possibleTypes' => NULL, |
||
228 | ), |
||
229 | array ( |
||
230 | 'kind' => 'OBJECT', |
||
231 | 'name' => '__Type', |
||
232 | 'fields' => |
||
233 | array ( |
||
234 | 0 => |
||
235 | array ( |
||
236 | 'name' => 'kind', |
||
237 | 'args' => |
||
238 | array ( |
||
239 | ), |
||
240 | 'type' => |
||
241 | array ( |
||
242 | 'kind' => 'NON_NULL', |
||
243 | 'name' => NULL, |
||
244 | 'ofType' => |
||
245 | array ( |
||
246 | 'kind' => 'ENUM', |
||
247 | 'name' => '__TypeKind', |
||
248 | ), |
||
249 | ), |
||
250 | 'isDeprecated' => false, |
||
251 | 'deprecationReason' => NULL, |
||
252 | ), |
||
253 | 1 => |
||
254 | array ( |
||
255 | 'name' => 'name', |
||
256 | 'args' => |
||
257 | array ( |
||
258 | ), |
||
259 | 'type' => |
||
260 | array ( |
||
261 | 'kind' => 'SCALAR', |
||
262 | 'name' => 'String', |
||
263 | ), |
||
264 | 'isDeprecated' => false, |
||
265 | 'deprecationReason' => NULL, |
||
266 | ), |
||
267 | 2 => |
||
268 | array ( |
||
269 | 'name' => 'description', |
||
270 | 'args' => |
||
271 | array ( |
||
272 | ), |
||
273 | 'type' => |
||
274 | array ( |
||
275 | 'kind' => 'SCALAR', |
||
276 | 'name' => 'String', |
||
277 | ), |
||
278 | 'isDeprecated' => false, |
||
279 | 'deprecationReason' => NULL, |
||
280 | ), |
||
281 | 3 => |
||
282 | array ( |
||
283 | 'name' => 'fields', |
||
284 | 'args' => |
||
285 | array ( |
||
286 | 0 => |
||
287 | array ( |
||
288 | 'name' => 'includeDeprecated', |
||
289 | 'type' => |
||
290 | array ( |
||
291 | 'kind' => 'SCALAR', |
||
292 | 'name' => 'Boolean', |
||
293 | ), |
||
294 | 'defaultValue' => 'false', |
||
295 | ), |
||
296 | ), |
||
297 | 'type' => |
||
298 | array ( |
||
299 | 'kind' => 'LIST', |
||
300 | 'name' => NULL, |
||
301 | 'ofType' => |
||
302 | array ( |
||
303 | 'kind' => 'NON_NULL', |
||
304 | 'name' => NULL, |
||
305 | 'ofType' => |
||
306 | array ( |
||
307 | 'kind' => 'OBJECT', |
||
308 | 'name' => '__Field', |
||
309 | ), |
||
310 | ), |
||
311 | ), |
||
312 | 'isDeprecated' => false, |
||
313 | 'deprecationReason' => NULL, |
||
314 | ), |
||
315 | 4 => |
||
316 | array ( |
||
317 | 'name' => 'interfaces', |
||
318 | 'args' => |
||
319 | array ( |
||
320 | ), |
||
321 | 'type' => |
||
322 | array ( |
||
323 | 'kind' => 'LIST', |
||
324 | 'name' => NULL, |
||
325 | 'ofType' => |
||
326 | array ( |
||
327 | 'kind' => 'NON_NULL', |
||
328 | 'name' => NULL, |
||
329 | 'ofType' => |
||
330 | array ( |
||
331 | 'kind' => 'OBJECT', |
||
332 | 'name' => '__Type', |
||
333 | ), |
||
334 | ), |
||
335 | ), |
||
336 | 'isDeprecated' => false, |
||
337 | 'deprecationReason' => NULL, |
||
338 | ), |
||
339 | 5 => |
||
340 | array ( |
||
341 | 'name' => 'possibleTypes', |
||
342 | 'args' => |
||
343 | array ( |
||
344 | ), |
||
345 | 'type' => |
||
346 | array ( |
||
347 | 'kind' => 'LIST', |
||
348 | 'name' => NULL, |
||
349 | 'ofType' => |
||
350 | array ( |
||
351 | 'kind' => 'NON_NULL', |
||
352 | 'name' => NULL, |
||
353 | 'ofType' => |
||
354 | array ( |
||
355 | 'kind' => 'OBJECT', |
||
356 | 'name' => '__Type', |
||
357 | ), |
||
358 | ), |
||
359 | ), |
||
360 | 'isDeprecated' => false, |
||
361 | 'deprecationReason' => NULL, |
||
362 | ), |
||
363 | 6 => |
||
364 | array ( |
||
365 | 'name' => 'enumValues', |
||
366 | 'args' => |
||
367 | array ( |
||
368 | 0 => |
||
369 | array ( |
||
370 | 'name' => 'includeDeprecated', |
||
371 | 'type' => |
||
372 | array ( |
||
373 | 'kind' => 'SCALAR', |
||
374 | 'name' => 'Boolean', |
||
375 | ), |
||
376 | 'defaultValue' => 'false', |
||
377 | ), |
||
378 | ), |
||
379 | 'type' => |
||
380 | array ( |
||
381 | 'kind' => 'LIST', |
||
382 | 'name' => NULL, |
||
383 | 'ofType' => |
||
384 | array ( |
||
385 | 'kind' => 'NON_NULL', |
||
386 | 'name' => NULL, |
||
387 | 'ofType' => |
||
388 | array ( |
||
389 | 'kind' => 'OBJECT', |
||
390 | 'name' => '__EnumValue', |
||
391 | ), |
||
392 | ), |
||
393 | ), |
||
394 | 'isDeprecated' => false, |
||
395 | 'deprecationReason' => NULL, |
||
396 | ), |
||
397 | 7 => |
||
398 | array ( |
||
399 | 'name' => 'inputFields', |
||
400 | 'args' => |
||
401 | array ( |
||
402 | ), |
||
403 | 'type' => |
||
404 | array ( |
||
405 | 'kind' => 'LIST', |
||
406 | 'name' => NULL, |
||
407 | 'ofType' => |
||
408 | array ( |
||
409 | 'kind' => 'NON_NULL', |
||
410 | 'name' => NULL, |
||
411 | 'ofType' => |
||
412 | array ( |
||
413 | 'kind' => 'OBJECT', |
||
414 | 'name' => '__InputValue', |
||
415 | ), |
||
416 | ), |
||
417 | ), |
||
418 | 'isDeprecated' => false, |
||
419 | 'deprecationReason' => NULL, |
||
420 | ), |
||
421 | 8 => |
||
422 | array ( |
||
423 | 'name' => 'ofType', |
||
424 | 'args' => |
||
425 | array ( |
||
426 | ), |
||
427 | 'type' => |
||
428 | array ( |
||
429 | 'kind' => 'OBJECT', |
||
430 | 'name' => '__Type', |
||
431 | ), |
||
432 | 'isDeprecated' => false, |
||
433 | 'deprecationReason' => NULL, |
||
434 | ), |
||
435 | ), |
||
436 | 'inputFields' => NULL, |
||
437 | 'interfaces' => |
||
438 | array ( |
||
439 | ), |
||
440 | 'enumValues' => NULL, |
||
441 | 'possibleTypes' => NULL, |
||
442 | ), |
||
443 | array ( |
||
444 | 'kind' => 'ENUM', |
||
445 | 'name' => '__TypeKind', |
||
446 | 'fields' => NULL, |
||
447 | 'inputFields' => NULL, |
||
448 | 'interfaces' => NULL, |
||
449 | 'enumValues' => |
||
450 | array ( |
||
451 | 0 => |
||
452 | array ( |
||
453 | 'name' => 'SCALAR', |
||
454 | 'isDeprecated' => false, |
||
455 | 'deprecationReason' => NULL, |
||
456 | ), |
||
457 | 1 => |
||
458 | array ( |
||
459 | 'name' => 'OBJECT', |
||
460 | 'isDeprecated' => false, |
||
461 | 'deprecationReason' => NULL, |
||
462 | ), |
||
463 | 2 => |
||
464 | array ( |
||
465 | 'name' => 'INTERFACE', |
||
466 | 'isDeprecated' => false, |
||
467 | 'deprecationReason' => NULL, |
||
468 | ), |
||
469 | 3 => |
||
470 | array ( |
||
471 | 'name' => 'UNION', |
||
472 | 'isDeprecated' => false, |
||
473 | 'deprecationReason' => NULL, |
||
474 | ), |
||
475 | 4 => |
||
476 | array ( |
||
477 | 'name' => 'ENUM', |
||
478 | 'isDeprecated' => false, |
||
479 | 'deprecationReason' => NULL, |
||
480 | ), |
||
481 | 5 => |
||
482 | array ( |
||
483 | 'name' => 'INPUT_OBJECT', |
||
484 | 'isDeprecated' => false, |
||
485 | 'deprecationReason' => NULL, |
||
486 | ), |
||
487 | 6 => |
||
488 | array ( |
||
489 | 'name' => 'LIST', |
||
490 | 'isDeprecated' => false, |
||
491 | 'deprecationReason' => NULL, |
||
492 | ), |
||
493 | 7 => |
||
494 | array ( |
||
495 | 'name' => 'NON_NULL', |
||
496 | 'isDeprecated' => false, |
||
497 | 'deprecationReason' => NULL, |
||
498 | ), |
||
499 | ), |
||
500 | 'possibleTypes' => NULL, |
||
501 | ), |
||
502 | array ( |
||
503 | 'kind' => 'OBJECT', |
||
504 | 'name' => '__Field', |
||
505 | 'fields' => |
||
506 | array ( |
||
507 | 0 => |
||
508 | array ( |
||
509 | 'name' => 'name', |
||
510 | 'args' => |
||
511 | array ( |
||
512 | ), |
||
513 | 'type' => |
||
514 | array ( |
||
515 | 'kind' => 'NON_NULL', |
||
516 | 'name' => NULL, |
||
517 | 'ofType' => |
||
518 | array ( |
||
519 | 'kind' => 'SCALAR', |
||
520 | 'name' => 'String', |
||
521 | ), |
||
522 | ), |
||
523 | 'isDeprecated' => false, |
||
524 | 'deprecationReason' => NULL, |
||
525 | ), |
||
526 | 1 => |
||
527 | array ( |
||
528 | 'name' => 'description', |
||
529 | 'args' => |
||
530 | array ( |
||
531 | ), |
||
532 | 'type' => |
||
533 | array ( |
||
534 | 'kind' => 'SCALAR', |
||
535 | 'name' => 'String', |
||
536 | ), |
||
537 | 'isDeprecated' => false, |
||
538 | 'deprecationReason' => NULL, |
||
539 | ), |
||
540 | 2 => |
||
541 | array ( |
||
542 | 'name' => 'args', |
||
543 | 'args' => |
||
544 | array ( |
||
545 | ), |
||
546 | 'type' => |
||
547 | array ( |
||
548 | 'kind' => 'NON_NULL', |
||
549 | 'name' => NULL, |
||
550 | 'ofType' => |
||
551 | array ( |
||
552 | 'kind' => 'LIST', |
||
553 | 'name' => NULL, |
||
554 | 'ofType' => |
||
555 | array ( |
||
556 | 'kind' => 'NON_NULL', |
||
557 | 'name' => NULL, |
||
558 | 'ofType' => |
||
559 | array ( |
||
560 | 'kind' => 'OBJECT', |
||
561 | 'name' => '__InputValue', |
||
562 | ), |
||
563 | ), |
||
564 | ), |
||
565 | ), |
||
566 | 'isDeprecated' => false, |
||
567 | 'deprecationReason' => NULL, |
||
568 | ), |
||
569 | 3 => |
||
570 | array ( |
||
571 | 'name' => 'type', |
||
572 | 'args' => |
||
573 | array ( |
||
574 | ), |
||
575 | 'type' => |
||
576 | array ( |
||
577 | 'kind' => 'NON_NULL', |
||
578 | 'name' => NULL, |
||
579 | 'ofType' => |
||
580 | array ( |
||
581 | 'kind' => 'OBJECT', |
||
582 | 'name' => '__Type', |
||
583 | ), |
||
584 | ), |
||
585 | 'isDeprecated' => false, |
||
586 | 'deprecationReason' => NULL, |
||
587 | ), |
||
588 | 4 => |
||
589 | array ( |
||
590 | 'name' => 'isDeprecated', |
||
591 | 'args' => |
||
592 | array ( |
||
593 | ), |
||
594 | 'type' => |
||
595 | array ( |
||
596 | 'kind' => 'NON_NULL', |
||
597 | 'name' => NULL, |
||
598 | 'ofType' => |
||
599 | array ( |
||
600 | 'kind' => 'SCALAR', |
||
601 | 'name' => 'Boolean', |
||
602 | ), |
||
603 | ), |
||
604 | 'isDeprecated' => false, |
||
605 | 'deprecationReason' => NULL, |
||
606 | ), |
||
607 | 5 => |
||
608 | array ( |
||
609 | 'name' => 'deprecationReason', |
||
610 | 'args' => |
||
611 | array ( |
||
612 | ), |
||
613 | 'type' => |
||
614 | array ( |
||
615 | 'kind' => 'SCALAR', |
||
616 | 'name' => 'String', |
||
617 | ), |
||
618 | 'isDeprecated' => false, |
||
619 | 'deprecationReason' => NULL, |
||
620 | ), |
||
621 | ), |
||
622 | 'inputFields' => NULL, |
||
623 | 'interfaces' => |
||
624 | array ( |
||
625 | ), |
||
626 | 'enumValues' => NULL, |
||
627 | 'possibleTypes' => NULL, |
||
628 | ), |
||
629 | array ( |
||
630 | 'kind' => 'OBJECT', |
||
631 | 'name' => '__InputValue', |
||
632 | 'fields' => |
||
633 | array ( |
||
634 | 0 => |
||
635 | array ( |
||
636 | 'name' => 'name', |
||
637 | 'args' => |
||
638 | array ( |
||
639 | ), |
||
640 | 'type' => |
||
641 | array ( |
||
642 | 'kind' => 'NON_NULL', |
||
643 | 'name' => NULL, |
||
644 | 'ofType' => |
||
645 | array ( |
||
646 | 'kind' => 'SCALAR', |
||
647 | 'name' => 'String', |
||
648 | ), |
||
649 | ), |
||
650 | 'isDeprecated' => false, |
||
651 | 'deprecationReason' => NULL, |
||
652 | ), |
||
653 | 1 => |
||
654 | array ( |
||
655 | 'name' => 'description', |
||
656 | 'args' => |
||
657 | array ( |
||
658 | ), |
||
659 | 'type' => |
||
660 | array ( |
||
661 | 'kind' => 'SCALAR', |
||
662 | 'name' => 'String', |
||
663 | ), |
||
664 | 'isDeprecated' => false, |
||
665 | 'deprecationReason' => NULL, |
||
666 | ), |
||
667 | 2 => |
||
668 | array ( |
||
669 | 'name' => 'type', |
||
670 | 'args' => |
||
671 | array ( |
||
672 | ), |
||
673 | 'type' => |
||
674 | array ( |
||
675 | 'kind' => 'NON_NULL', |
||
676 | 'name' => NULL, |
||
677 | 'ofType' => |
||
678 | array ( |
||
679 | 'kind' => 'OBJECT', |
||
680 | 'name' => '__Type', |
||
681 | ), |
||
682 | ), |
||
683 | 'isDeprecated' => false, |
||
684 | 'deprecationReason' => NULL, |
||
685 | ), |
||
686 | 3 => |
||
687 | array ( |
||
688 | 'name' => 'defaultValue', |
||
689 | 'args' => |
||
690 | array ( |
||
691 | ), |
||
692 | 'type' => |
||
693 | array ( |
||
694 | 'kind' => 'SCALAR', |
||
695 | 'name' => 'String', |
||
696 | ), |
||
697 | 'isDeprecated' => false, |
||
698 | 'deprecationReason' => NULL, |
||
699 | ), |
||
700 | ), |
||
701 | 'inputFields' => NULL, |
||
702 | 'interfaces' => |
||
703 | array ( |
||
704 | ), |
||
705 | 'enumValues' => NULL, |
||
706 | 'possibleTypes' => NULL, |
||
707 | ), |
||
708 | array ( |
||
709 | 'kind' => 'OBJECT', |
||
710 | 'name' => '__EnumValue', |
||
711 | 'fields' => |
||
712 | array ( |
||
713 | 0 => |
||
714 | array ( |
||
715 | 'name' => 'name', |
||
716 | 'args' => |
||
717 | array ( |
||
718 | ), |
||
719 | 'type' => |
||
720 | array ( |
||
721 | 'kind' => 'NON_NULL', |
||
722 | 'name' => NULL, |
||
723 | 'ofType' => |
||
724 | array ( |
||
725 | 'kind' => 'SCALAR', |
||
726 | 'name' => 'String', |
||
727 | ), |
||
728 | ), |
||
729 | 'isDeprecated' => false, |
||
730 | 'deprecationReason' => NULL, |
||
731 | ), |
||
732 | 1 => |
||
733 | array ( |
||
734 | 'name' => 'description', |
||
735 | 'args' => |
||
736 | array ( |
||
737 | ), |
||
738 | 'type' => |
||
739 | array ( |
||
740 | 'kind' => 'SCALAR', |
||
741 | 'name' => 'String', |
||
742 | ), |
||
743 | 'isDeprecated' => false, |
||
744 | 'deprecationReason' => NULL, |
||
745 | ), |
||
746 | 2 => |
||
747 | array ( |
||
748 | 'name' => 'isDeprecated', |
||
749 | 'args' => |
||
750 | array ( |
||
751 | ), |
||
752 | 'type' => |
||
753 | array ( |
||
754 | 'kind' => 'NON_NULL', |
||
755 | 'name' => NULL, |
||
756 | 'ofType' => |
||
757 | array ( |
||
758 | 'kind' => 'SCALAR', |
||
759 | 'name' => 'Boolean', |
||
760 | ), |
||
761 | ), |
||
762 | 'isDeprecated' => false, |
||
763 | 'deprecationReason' => NULL, |
||
764 | ), |
||
765 | 3 => |
||
766 | array ( |
||
767 | 'name' => 'deprecationReason', |
||
768 | 'args' => |
||
769 | array ( |
||
770 | ), |
||
771 | 'type' => |
||
772 | array ( |
||
773 | 'kind' => 'SCALAR', |
||
774 | 'name' => 'String', |
||
775 | ), |
||
776 | 'isDeprecated' => false, |
||
777 | 'deprecationReason' => NULL, |
||
778 | ), |
||
779 | ), |
||
780 | 'inputFields' => NULL, |
||
781 | 'interfaces' => |
||
782 | array ( |
||
783 | ), |
||
784 | 'enumValues' => NULL, |
||
785 | 'possibleTypes' => NULL, |
||
786 | ), |
||
787 | array ( |
||
788 | 'kind' => 'OBJECT', |
||
789 | 'name' => '__Directive', |
||
790 | 'fields' => |
||
791 | array ( |
||
792 | 0 => |
||
793 | array ( |
||
794 | 'name' => 'name', |
||
795 | 'args' => |
||
796 | array ( |
||
797 | ), |
||
798 | 'type' => |
||
799 | array ( |
||
800 | 'kind' => 'NON_NULL', |
||
801 | 'name' => NULL, |
||
802 | 'ofType' => |
||
803 | array ( |
||
804 | 'kind' => 'SCALAR', |
||
805 | 'name' => 'String', |
||
806 | ), |
||
807 | ), |
||
808 | 'isDeprecated' => false, |
||
809 | 'deprecationReason' => NULL, |
||
810 | ), |
||
811 | 1 => |
||
812 | array ( |
||
813 | 'name' => 'description', |
||
814 | 'args' => |
||
815 | array ( |
||
816 | ), |
||
817 | 'type' => |
||
818 | array ( |
||
819 | 'kind' => 'SCALAR', |
||
820 | 'name' => 'String', |
||
821 | ), |
||
822 | 'isDeprecated' => false, |
||
823 | 'deprecationReason' => NULL, |
||
824 | ), |
||
825 | 2 => |
||
826 | array ( |
||
827 | 'name' => 'locations', |
||
828 | 'args' => |
||
829 | array ( |
||
830 | ), |
||
831 | 'type' => |
||
832 | array ( |
||
833 | 'kind' => 'NON_NULL', |
||
834 | 'name' => NULL, |
||
835 | 'ofType' => |
||
836 | array ( |
||
837 | 'kind' => 'LIST', |
||
838 | 'name' => NULL, |
||
839 | 'ofType' => |
||
840 | array ( |
||
841 | 'kind' => 'NON_NULL', |
||
842 | 'name' => NULL, |
||
843 | 'ofType' => |
||
844 | array ( |
||
845 | 'kind' => 'ENUM', |
||
846 | 'name' => '__DirectiveLocation', |
||
847 | ), |
||
848 | ), |
||
849 | ), |
||
850 | ), |
||
851 | 'isDeprecated' => false, |
||
852 | 'deprecationReason' => NULL, |
||
853 | ), |
||
854 | 3 => |
||
855 | array ( |
||
856 | 'name' => 'args', |
||
857 | 'args' => |
||
858 | array ( |
||
859 | ), |
||
860 | 'type' => |
||
861 | array ( |
||
862 | 'kind' => 'NON_NULL', |
||
863 | 'name' => NULL, |
||
864 | 'ofType' => |
||
865 | array ( |
||
866 | 'kind' => 'LIST', |
||
867 | 'name' => NULL, |
||
868 | 'ofType' => |
||
869 | array ( |
||
870 | 'kind' => 'NON_NULL', |
||
871 | 'name' => NULL, |
||
872 | 'ofType' => |
||
873 | array ( |
||
874 | 'kind' => 'OBJECT', |
||
875 | 'name' => '__InputValue', |
||
876 | ), |
||
877 | ), |
||
878 | ), |
||
879 | ), |
||
880 | 'isDeprecated' => false, |
||
881 | 'deprecationReason' => NULL, |
||
882 | ), |
||
883 | 4 => |
||
884 | array ( |
||
885 | 'name' => 'onOperation', |
||
886 | 'args' => |
||
887 | array ( |
||
888 | ), |
||
889 | 'type' => |
||
890 | array ( |
||
891 | 'kind' => 'NON_NULL', |
||
892 | 'name' => NULL, |
||
893 | 'ofType' => |
||
894 | array ( |
||
895 | 'kind' => 'SCALAR', |
||
896 | 'name' => 'Boolean', |
||
897 | ), |
||
898 | ), |
||
899 | 'isDeprecated' => true, |
||
900 | 'deprecationReason' => 'Use `locations`.', |
||
901 | ), |
||
902 | 5 => |
||
903 | array ( |
||
904 | 'name' => 'onFragment', |
||
905 | 'args' => |
||
906 | array ( |
||
907 | ), |
||
908 | 'type' => |
||
909 | array ( |
||
910 | 'kind' => 'NON_NULL', |
||
911 | 'name' => NULL, |
||
912 | 'ofType' => |
||
913 | array ( |
||
914 | 'kind' => 'SCALAR', |
||
915 | 'name' => 'Boolean', |
||
916 | ), |
||
917 | ), |
||
918 | 'isDeprecated' => true, |
||
919 | 'deprecationReason' => 'Use `locations`.', |
||
920 | ), |
||
921 | 6 => |
||
922 | array ( |
||
923 | 'name' => 'onField', |
||
924 | 'args' => |
||
925 | array ( |
||
926 | ), |
||
927 | 'type' => |
||
928 | array ( |
||
929 | 'kind' => 'NON_NULL', |
||
930 | 'name' => NULL, |
||
931 | 'ofType' => |
||
932 | array ( |
||
933 | 'kind' => 'SCALAR', |
||
934 | 'name' => 'Boolean', |
||
935 | |||
936 | ), |
||
937 | ), |
||
938 | 'isDeprecated' => true, |
||
939 | 'deprecationReason' => 'Use `locations`.', |
||
940 | ), |
||
941 | ), |
||
942 | 'inputFields' => NULL, |
||
943 | 'interfaces' => |
||
944 | array ( |
||
945 | ), |
||
946 | 'enumValues' => NULL, |
||
947 | 'possibleTypes' => NULL, |
||
948 | ), |
||
949 | array ( |
||
950 | 'kind' => 'ENUM', |
||
951 | 'name' => '__DirectiveLocation', |
||
952 | 'fields' => NULL, |
||
953 | 'inputFields' => NULL, |
||
954 | 'interfaces' => NULL, |
||
955 | 'enumValues' => |
||
956 | array ( |
||
957 | 0 => |
||
958 | array ( |
||
959 | 'name' => 'QUERY', |
||
960 | 'isDeprecated' => false, |
||
961 | 'deprecationReason' => null |
||
962 | ), |
||
963 | 1 => |
||
964 | array ( |
||
965 | 'name' => 'MUTATION', |
||
966 | 'isDeprecated' => false, |
||
967 | 'deprecationReason' => null |
||
968 | ), |
||
969 | 2 => |
||
970 | array ( |
||
971 | 'name' => 'SUBSCRIPTION', |
||
972 | 'isDeprecated' => false, |
||
973 | 'deprecationReason' => null |
||
974 | ), |
||
975 | 3 => |
||
976 | array ( |
||
977 | 'name' => 'FIELD', |
||
978 | 'isDeprecated' => false, |
||
979 | 'deprecationReason' => null |
||
980 | ), |
||
981 | 4 => |
||
982 | array ( |
||
983 | 'name' => 'FRAGMENT_DEFINITION', |
||
984 | 'isDeprecated' => false, |
||
985 | 'deprecationReason' => null |
||
986 | ), |
||
987 | 5 => |
||
988 | array ( |
||
989 | 'name' => 'FRAGMENT_SPREAD', |
||
990 | 'isDeprecated' => false, |
||
991 | 'deprecationReason' => null |
||
992 | ), |
||
993 | 6 => |
||
994 | array ( |
||
995 | 'name' => 'INLINE_FRAGMENT', |
||
996 | 'isDeprecated' => false, |
||
997 | 'deprecationReason' => null |
||
998 | ), |
||
999 | ), |
||
1000 | 'possibleTypes' => NULL, |
||
1001 | ), |
||
1002 | ), |
||
1003 | 'directives' => |
||
1004 | array ( |
||
1005 | 0 => |
||
1006 | array ( |
||
1007 | 'name' => 'include', |
||
1008 | 'locations' => |
||
1009 | array ( |
||
1010 | 0 => 'FIELD', |
||
1011 | 1 => 'FRAGMENT_SPREAD', |
||
1012 | 2 => 'INLINE_FRAGMENT', |
||
1013 | ), |
||
1014 | 'args' => |
||
1015 | array ( |
||
1016 | 0 => |
||
1017 | array ( |
||
1018 | 'defaultValue' => NULL, |
||
1019 | 'name' => 'if', |
||
1020 | 'type' => |
||
1021 | array ( |
||
1022 | 'kind' => 'NON_NULL', |
||
1023 | 'name' => NULL, |
||
1024 | 'ofType' => |
||
1025 | array ( |
||
1026 | 'kind' => 'SCALAR', |
||
1027 | 'name' => 'Boolean', |
||
1028 | ), |
||
1029 | ), |
||
1030 | ), |
||
1031 | ), |
||
1032 | ), |
||
1033 | 1 => |
||
1034 | array ( |
||
1035 | 'name' => 'skip', |
||
1036 | 'locations' => |
||
1037 | array ( |
||
1038 | 0 => 'FIELD', |
||
1039 | 1 => 'FRAGMENT_SPREAD', |
||
1040 | 2 => 'INLINE_FRAGMENT', |
||
1041 | ), |
||
1042 | 'args' => |
||
1043 | array ( |
||
1044 | 0 => |
||
1045 | array ( |
||
1046 | 'defaultValue' => NULL, |
||
1047 | 'name' => 'if', |
||
1048 | 'type' => |
||
1049 | array ( |
||
1050 | 'kind' => 'NON_NULL', |
||
1051 | 'name' => NULL, |
||
1052 | 'ofType' => |
||
1053 | array ( |
||
1054 | 'kind' => 'SCALAR', |
||
1055 | 'name' => 'Boolean', |
||
1056 | ), |
||
1057 | ), |
||
1058 | ), |
||
1059 | ), |
||
1060 | ), |
||
1061 | ), |
||
1062 | ), |
||
1063 | ) |
||
1064 | ); |
||
1065 | |||
1066 | $actual = GraphQL::executeQuery($emptySchema, $request)->toArray(); |
||
1067 | |||
1068 | // $this->assertEquals($expected, $actual); |
||
1069 | $this->assertArraySubset($expected, $actual); |
||
1070 | } |
||
1618 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.