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

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

ProcessorTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testExtendsUnknownType() 0 7 1
A testCircularExtendsType() 0 7 1
A testNotAllowedType() 0 7 1
1
<?php
2
3
namespace Overblog\GraphQLBundle\Tests\Config;
4
5
use Overblog\GraphQLBundle\Config\Processor;
6
use PHPUnit\Framework\TestCase;
7
8
class ProcessorTest extends TestCase
9
{
10
    private $fixtures = [
11
        'foo' => ['extends' => ['bar', 'baz'], 'type' => 'object', 'config' => []],
12
        'bar' => ['extends' => ['toto'], 'type' => 'object', 'config' => []],
13
        'baz' => ['type' => 'object', 'config' => []],
14
        'toto' => ['type' => 'interface', 'config' => []],
15
    ];
16
17
    /**
18
     * @expectedException \InvalidArgumentException
19
     * @expectedExceptionMessage Type "toto" extends by "bar" not be found.
20
     */
21
    public function testExtendsUnknownType()
22
    {
23
        $configs = $this->fixtures;
24
        unset($configs['toto']);
25
26
        Processor::processConfigsExtends($configs);
27
    }
28
29
    /**
30
     * @expectedException \InvalidArgumentException
31
     * @expectedExceptionMessage Type circular inheritance detected (foo->bar->toto->foo).
32
     */
33
    public function testCircularExtendsType()
34
    {
35
        $configs = $this->fixtures;
36
        $configs['toto']['extends'] = ['foo'];
37
38
        Processor::processConfigsExtends($configs);
39
    }
40
41
    /**
42
     * @expectedException \InvalidArgumentException
43
     * @expectedExceptionMessage Type "toto" can't extends "bar" because "enum" is not allowed type (["object","interface"]).
44
     */
45
    public function testNotAllowedType()
46
    {
47
        $configs = $this->fixtures;
48
        $configs['toto']['type'] = 'enum';
49
50
        Processor::processConfigsExtends($configs);
51
    }
52
}
53