Passed
Pull Request — master (#75)
by David
03:18
created

SchemaTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
dl 0
loc 24
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A hp$0 ➔ getQueries() 0 3 1
testEmptyQuery() 0 21 ?
A hp$0 ➔ testEmptyQuery() 0 21 1
A hp$0 ➔ getMutations() 0 3 1
1
<?php
2
3
namespace TheCodingMachine\GraphQL\Controllers;
4
5
use PHPUnit\Framework\TestCase;
6
7
class SchemaTest extends AbstractQueryProviderTest
8
{
9
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
29
        $fields = $schema->getMutationType()->getFields();
30
        $this->assertArrayHasKey('dummyMutation', $fields);
31
    }
32
}
33