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 (#277)
by Jérémiah
14:57
created

DefinitionTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 6
dl 0
loc 40
rs 10
1
<?php
2
3
namespace Overblog\GraphQLBundle\Tests\Functional\Security;
4
5
use GraphQL\Type\Definition\EnumType;
6
use GraphQL\Type\Definition\ObjectType;
7
use GraphQL\Type\Definition\Type;
8
use Overblog\GraphQLBundle\Tests\Functional\TestCase;
9
10
class DefinitionTest extends TestCase
11
{
12
    protected function setUp()
13
    {
14
        parent::setUp();
15
16
        static::bootKernel(['test_case' => 'definition']);
17
    }
18
19
    public function testDefinesEnumTypeWithDeprecatedValue()
20
    {
21
        /** @var EnumType $enumTypeWithDeprecatedValue */
22
        $enumTypeWithDeprecatedValue = $this->getType('EnumWithDeprecatedValue');
23
        $value = $enumTypeWithDeprecatedValue->getValues()[0];
24
        $this->assertEquals([
25
            'name' => 'foo',
26
            'description' => null,
27
            'deprecationReason' => 'Just because',
28
            'value' => 'foo',
29
        ], $value->config);
30
        $this->assertTrue($value->isDeprecated());
31
    }
32
33
    public function testDefinesAnObjectTypeWithDeprecatedField()
34
    {
35
        /** @var ObjectType $TypeWithDeprecatedField */
36
        $TypeWithDeprecatedField = $this->getType('ObjectWithDeprecatedField');
37
        $field = $TypeWithDeprecatedField->getField('bar');
38
        $this->assertEquals(Type::string(), $field->getType());
39
        $this->assertTrue($field->isDeprecated());
40
        $this->assertEquals('A terrible reason', $field->deprecationReason);
41
        $this->assertEquals('bar', $field->name);
42
        $this->assertEquals([], $field->args);
43
    }
44
45
    private function getType($type)
46
    {
47
        return $this->getContainer()->get('overblog_graphql.type_resolver')->resolve($type);
48
    }
49
}
50