Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testEmptyQuery() |
||
11 | { |
||
12 | $queryProvider = new class implements QueryProviderInterface { |
||
13 | public function getQueries(): array |
||
14 | { |
||
15 | return []; |
||
16 | } |
||
17 | |||
18 | public function getMutations(): array |
||
19 | { |
||
20 | return []; |
||
21 | } |
||
22 | }; |
||
23 | |||
24 | $schema = new Schema($queryProvider, $this->getTypeMapper(), $this->getTypeResolver()); |
||
25 | |||
26 | $fields = $schema->getQueryType()->getFields(); |
||
27 | $this->assertArrayHasKey('dummyQuery', $fields); |
||
28 | $resolve = $fields['dummyQuery']->resolveFn; |
||
29 | $this->assertSame('This is a placeholder query. Please create a query using the @Query annotation.', $resolve()); |
||
30 | |||
31 | $fields = $schema->getMutationType()->getFields(); |
||
32 | $this->assertArrayHasKey('dummyMutation', $fields); |
||
33 | $resolve = $fields['dummyMutation']->resolveFn; |
||
34 | $this->assertSame('This is a placeholder mutation. Please create a mutation using the @Mutation annotation.', $resolve()); |
||
35 | } |
||
37 |