Completed
Pull Request — master (#75)
by
unknown
04:51
created
Tests/Library/Validator/ResolveValidatorTest.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
 use Youshido\GraphQL\Type\Scalar\StringType;
28 28
 use Youshido\GraphQL\Type\Union\UnionType;
29 29
 use Youshido\GraphQL\Validator\ResolveValidator\ResolveValidator;
30
-use Youshido\Tests\DataProvider\TestEnumType;
31 30
 use Youshido\Tests\DataProvider\TestInterfaceType;
32 31
 use Youshido\Tests\DataProvider\TestObjectType;
33 32
 use Youshido\Tests\DataProvider\TestUnionType;
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -67,36 +67,36 @@
 block discarded – undo
67 67
 
68 68
     public function testValidFragmentTypeWithComposite()
69 69
     {
70
-      $validator = new ResolveValidator(new ExecutionContext(new TestSchema()));
71
-      $userType = new ObjectType([
70
+        $validator = new ResolveValidator(new ExecutionContext(new TestSchema()));
71
+        $userType = new ObjectType([
72 72
         'name'       => 'User',
73 73
         'fields'     => [
74
-          'name' => new StringType(),
74
+            'name' => new StringType(),
75 75
         ],
76 76
         'interfaces' => [new TestInterfaceType()]
77
-      ]);
77
+        ]);
78 78
 
79
-      $fragment          = new Fragment('name', 'User', []);
80
-      $fragmentReference = new FragmentReference('name');
81
-      $validator->assertValidFragmentForField($fragment, $fragmentReference, new NonNullType($userType));
79
+        $fragment          = new Fragment('name', 'User', []);
80
+        $fragmentReference = new FragmentReference('name');
81
+        $validator->assertValidFragmentForField($fragment, $fragmentReference, new NonNullType($userType));
82 82
     }
83 83
 
84 84
     public function testValidFragmentTypeWithUnion()
85 85
     {
86
-      $validator = new ResolveValidator(new ExecutionContext(new TestSchema()));
86
+        $validator = new ResolveValidator(new ExecutionContext(new TestSchema()));
87 87
 
88
-      $unionType = new ObjectType([
88
+        $unionType = new ObjectType([
89 89
         'name' => 'Mammals',
90 90
         'type'    => new TestUnionType(),
91 91
         'resolve' => function ($value, $args, ResolveInfo $info) {
92
-          $testObject = new TestObjectType();
93
-          return [$testObject->getData()];
92
+            $testObject = new TestObjectType();
93
+            return [$testObject->getData()];
94 94
         }
95
-      ]);
95
+        ]);
96 96
 
97
-      $fragment          = new Fragment('name', 'TestObject', ['name']);
98
-      $fragmentReference = new FragmentReference('name');
99
-      $validator->assertValidFragmentForField($fragment, $fragmentReference, $unionType);
97
+        $fragment          = new Fragment('name', 'TestObject', ['name']);
98
+        $fragmentReference = new FragmentReference('name');
99
+        $validator->assertValidFragmentForField($fragment, $fragmentReference, $unionType);
100 100
     }
101 101
 
102 102
     /**
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
       $unionType = new ObjectType([
89 89
         'name' => 'Mammals',
90 90
         'type'    => new TestUnionType(),
91
-        'resolve' => function ($value, $args, ResolveInfo $info) {
91
+        'resolve' => function($value, $args, ResolveInfo $info) {
92 92
           $testObject = new TestObjectType();
93 93
           return [$testObject->getData()];
94 94
         }
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function testInvalidFragmentType()
106 106
     {
107
-        $userType          = new ObjectType([
107
+        $userType = new ObjectType([
108 108
             'name'   => 'User',
109 109
             'fields' => [
110 110
                 'name' => new StringType(),
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $union = new UnionType([
142 142
             'name'        => 'TestUnion',
143 143
             'types'       => [new TestObjectType()],
144
-            'resolveType' => function () {
144
+            'resolveType' => function() {
145 145
                 return new BooleanType();
146 146
             }
147 147
         ]);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $union = new UnionType([
156 156
             'name'        => 'TestUnion',
157 157
             'types'       => [new TestObjectType()],
158
-            'resolveType' => function () {
158
+            'resolveType' => function() {
159 159
                 return new TestObjectType();
160 160
             }
161 161
         ]);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $variableWrongTypeReference = new VariableReference('year', $variableWrongType);
181 181
 
182 182
 
183
-        $field     = new Field([
183
+        $field = new Field([
184 184
             'name' => 'hero',
185 185
             'type' => new ObjectType([
186 186
                 'name'   => 'User',
Please login to merge, or discard this patch.