@@ 105-122 (lines=18) @@ | ||
102 | $this->assertArrayNotHasKey('errors', $processor->getResponseData()); |
|
103 | } |
|
104 | ||
105 | public function testListNullResponse() |
|
106 | { |
|
107 | $processor = new Processor(new Schema([ |
|
108 | 'query' => new ObjectType([ |
|
109 | 'name' => 'RootQuery', |
|
110 | 'fields' => [ |
|
111 | 'list' => [ |
|
112 | 'type' => new ListType(new StringType()), |
|
113 | 'resolve' => function () { |
|
114 | return null; |
|
115 | } |
|
116 | ] |
|
117 | ] |
|
118 | ]) |
|
119 | ])); |
|
120 | $data = $processor->processPayload(' { list }')->getResponseData(); |
|
121 | $this->assertEquals(['data' => ['list' => null]], $data); |
|
122 | } |
|
123 | ||
124 | ||
125 | public function testSubscriptionNullResponse() |
|
@@ 125-142 (lines=18) @@ | ||
122 | } |
|
123 | ||
124 | ||
125 | public function testSubscriptionNullResponse() |
|
126 | { |
|
127 | $processor = new Processor(new Schema([ |
|
128 | 'query' => new ObjectType([ |
|
129 | 'name' => 'RootQuery', |
|
130 | 'fields' => [ |
|
131 | 'list' => [ |
|
132 | 'type' => new ListType(new StringType()), |
|
133 | 'resolve' => function () { |
|
134 | return null; |
|
135 | } |
|
136 | ] |
|
137 | ] |
|
138 | ]) |
|
139 | ])); |
|
140 | $data = $processor->processPayload(' { __schema { subscriptionType { name } } }')->getResponseData(); |
|
141 | $this->assertEquals(['data' => ['__schema' => ['subscriptionType' => null]]], $data); |
|
142 | } |
|
143 | ||
144 | public function testSchemaOperations() |
|
145 | { |