| @@ 79-96 (lines=18) @@ | ||
| 76 | $this->assertArrayNotHasKey('errors', $processor->getResponseData()); |
|
| 77 | } |
|
| 78 | ||
| 79 | public function testListNullResponse() |
|
| 80 | { |
|
| 81 | $processor = new Processor(new Schema([ |
|
| 82 | 'query' => new ObjectType([ |
|
| 83 | 'name' => 'RootQuery', |
|
| 84 | 'fields' => [ |
|
| 85 | 'list' => [ |
|
| 86 | 'type' => new ListType(new StringType()), |
|
| 87 | 'resolve' => function () { |
|
| 88 | return null; |
|
| 89 | } |
|
| 90 | ] |
|
| 91 | ] |
|
| 92 | ]) |
|
| 93 | ])); |
|
| 94 | $data = $processor->processPayload(' { list }')->getResponseData(); |
|
| 95 | $this->assertEquals(['data' => ['list' => null]], $data); |
|
| 96 | } |
|
| 97 | ||
| 98 | ||
| 99 | public function testSubscriptionNullResponse() |
|
| @@ 99-116 (lines=18) @@ | ||
| 96 | } |
|
| 97 | ||
| 98 | ||
| 99 | public function testSubscriptionNullResponse() |
|
| 100 | { |
|
| 101 | $processor = new Processor(new Schema([ |
|
| 102 | 'query' => new ObjectType([ |
|
| 103 | 'name' => 'RootQuery', |
|
| 104 | 'fields' => [ |
|
| 105 | 'list' => [ |
|
| 106 | 'type' => new ListType(new StringType()), |
|
| 107 | 'resolve' => function () { |
|
| 108 | return null; |
|
| 109 | } |
|
| 110 | ] |
|
| 111 | ] |
|
| 112 | ]) |
|
| 113 | ])); |
|
| 114 | $data = $processor->processPayload(' { __schema { subscriptionType { name } } }')->getResponseData(); |
|
| 115 | $this->assertEquals(['data' => ['__schema' => ['subscriptionType' => null]]], $data); |
|
| 116 | } |
|
| 117 | ||
| 118 | public function testSchemaOperations() |
|
| 119 | { |
|