Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#237)
by Jérémiah
07:12
created

InheritanceTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 71
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 7 1
B testObjectInheritance() 0 30 1
A testEnumInheritance() 0 20 1
A testDecoratorTypeShouldRemovedFromFinalConfig() 0 5 1
1
<?php
2
3
namespace Overblog\GraphQLBundle\Tests\Functional\Relay\Connection;
4
5
use Overblog\GraphQLBundle\Tests\Functional\TestCase;
6
7
class InheritanceTest extends TestCase
8
{
9
    /** @var array */
10
    private $config;
11
12
    protected function setUp()
13
    {
14
        parent::setUp();
15
16
        static::bootKernel(['test_case' => 'inheritance']);
17
        $this->config = static::$kernel->getContainer()->getParameter('overblog_graphql_types.config');
0 ignored issues
show
Documentation Bug introduced by
It seems like static::$kernel->getCont..._graphql_types.config') of type * is incompatible with the declared type array of property $config.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
18
    }
19
20
    public function testObjectInheritance()
21
    {
22
        $this->assertArrayHasKey('Query', $this->config);
23
        $this->assertEquals(
24
            [
25
                'type' => 'object',
26
                'extends' => ['QueryFoo', 'QueryBar', 'QueryHelloWord'],
27
                'decorator' => false,
28
                'config' => [
29
                    'fields' => [
30
                        'period' => [
31
                            'type' => 'Period',
32
                            'args' => [],
33
                        ],
34
                        'bar' => [
35
                            'type' => 'String',
36
                            'args' => [],
37
                        ],
38
                        'sayHello' => [
39
                            'type' => 'String',
40
                            'args' => [],
41
                        ],
42
                    ],
43
                    'interfaces' => ['QueryHelloWord'],
44
                    'name' => 'Query',
45
                ],
46
            ],
47
            $this->config['Query']
48
        );
49
    }
50
51
    public function testEnumInheritance()
52
    {
53
        $this->assertArrayHasKey('Period', $this->config);
54
        $this->assertEquals(
55
            [
56
                'type' => 'enum',
57
                'extends' => ['Day', 'Month', 'Year'],
58
                'decorator' => false,
59
                'config' => [
60
                    'name' => 'Period',
61
                    'values' => [
62
                        'YEAR' => ['value' => 3],
63
                        'MONTH' => ['value' => 2],
64
                        'DAY' => ['value' => 1],
65
                    ],
66
                ],
67
            ],
68
            $this->config['Period']
69
        );
70
    }
71
72
    public function testDecoratorTypeShouldRemovedFromFinalConfig()
73
    {
74
        $this->assertArrayNotHasKey('QueryBar', $this->config);
75
        $this->assertArrayNotHasKey('QueryFoo', $this->config);
76
    }
77
}
78