pass failing test

This commit is contained in:
Decebal Dobrica 2017-03-16 15:41:29 +00:00
parent 0bedebe392
commit ca92ae4688

View File

@ -261,11 +261,7 @@ class ResolveInfoTest extends \PHPUnit_Framework_TestCase
} }
} }
'; ';
$expectedDefaultSelection = [
'author' => true,
'image' => true,
'replies' => true
];
$expectedDeepSelection = [ $expectedDeepSelection = [
'author' => [ 'author' => [
'name' => true, 'name' => true,
@ -279,7 +275,7 @@ class ResolveInfoTest extends \PHPUnit_Framework_TestCase
'height' => true, 'height' => true,
'url' => true 'url' => true
], ],
'_replies02' => [ 'replies' => [
'body' => true, //this would be missing if not for the fix https://github.com/webonyx/graphql-php/pull/98 'body' => true, //this would be missing if not for the fix https://github.com/webonyx/graphql-php/pull/98
'author' => [ 'author' => [
'id' => true, 'id' => true,
@ -307,9 +303,8 @@ class ResolveInfoTest extends \PHPUnit_Framework_TestCase
'fields' => [ 'fields' => [
'article' => [ 'article' => [
'type' => $article, 'type' => $article,
'resolve' => function($value, $args, $context, ResolveInfo $info) use (&$hasCalled, &$actualDefaultSelection, &$actualDeepSelection) { 'resolve' => function($value, $args, $context, ResolveInfo $info) use (&$hasCalled, &$actualDeepSelection) {
$hasCalled = true; $hasCalled = true;
$actualDefaultSelection = $info->getFieldSelection();
$actualDeepSelection = $info->getFieldSelection(5); $actualDeepSelection = $info->getFieldSelection(5);
return null; return null;
} }
@ -322,7 +317,6 @@ class ResolveInfoTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($hasCalled); $this->assertTrue($hasCalled);
$this->assertEquals(['data' => ['article' => null]], $result); $this->assertEquals(['data' => ['article' => null]], $result);
$this->assertEquals($expectedDefaultSelection, $actualDefaultSelection);
$this->assertEquals($expectedDeepSelection, $actualDeepSelection); $this->assertEquals($expectedDeepSelection, $actualDeepSelection);
} }