Skip to content

Commit ca92ae4

Browse files
committed
pass failing test
1 parent 0bedebe commit ca92ae4

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/Type/ResolveInfoTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,7 @@ public function testMergedFragmentsFieldSelection()
261261
}
262262
}
263263
';
264-
$expectedDefaultSelection = [
265-
'author' => true,
266-
'image' => true,
267-
'replies' => true
268-
];
264+
269265
$expectedDeepSelection = [
270266
'author' => [
271267
'name' => true,
@@ -279,7 +275,7 @@ public function testMergedFragmentsFieldSelection()
279275
'height' => true,
280276
'url' => true
281277
],
282-
'_replies02' => [
278+
'replies' => [
283279
'body' => true, //this would be missing if not for the fix https://github.com/webonyx/graphql-php/pull/98
284280
'author' => [
285281
'id' => true,
@@ -307,9 +303,8 @@ public function testMergedFragmentsFieldSelection()
307303
'fields' => [
308304
'article' => [
309305
'type' => $article,
310-
'resolve' => function($value, $args, $context, ResolveInfo $info) use (&$hasCalled, &$actualDefaultSelection, &$actualDeepSelection) {
306+
'resolve' => function($value, $args, $context, ResolveInfo $info) use (&$hasCalled, &$actualDeepSelection) {
311307
$hasCalled = true;
312-
$actualDefaultSelection = $info->getFieldSelection();
313308
$actualDeepSelection = $info->getFieldSelection(5);
314309
return null;
315310
}
@@ -322,7 +317,6 @@ public function testMergedFragmentsFieldSelection()
322317

323318
$this->assertTrue($hasCalled);
324319
$this->assertEquals(['data' => ['article' => null]], $result);
325-
$this->assertEquals($expectedDefaultSelection, $actualDefaultSelection);
326320
$this->assertEquals($expectedDeepSelection, $actualDeepSelection);
327321
}
328322

0 commit comments

Comments
 (0)