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
Push — master ( 5c920d...e34953 )
by Jérémiah
05:53 queued 24s
created

ExecutorTest::testDisabledDebugInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Tests\Resolver;
13
14
use GraphQL\Schema;
15
use GraphQL\Type\Definition\ObjectType;
16
use GraphQL\Type\Definition\Type;
17
use Overblog\GraphQLBundle\Request\Executor;
18
19
class ExecutorTest extends \PHPUnit_Framework_TestCase
20
{
21
    /** @var Executor */
22
    private $executor;
23
24
    private $request = ['query' => 'query debug{ myField }', 'variables' => [], 'operationName' => null];
25
26
    public function setUp()
27
    {
28
        $this->executor = new Executor();
29
    }
30
31
    public function testDisabledDebugInfo()
32
    {
33
        $this->addSchema();
34
        $this->assertArrayNotHasKey('debug', $this->executor->disabledDebugInfo()->execute($this->request)->extensions);
35
    }
36
37
    public function testEnabledDebugInfo()
38
    {
39
        $this->addSchema();
40
        $result = $this->executor->enabledDebugInfo()->execute($this->request);
41
42
        $this->assertArrayHasKey('debug', $result->extensions);
43
        $this->assertArrayHasKey('executionTime', $result->extensions['debug']);
44
        $this->assertArrayHasKey('memoryUsage', $result->extensions['debug']);
45
    }
46
47
    /**
48
     * @expectedException \RuntimeException
49
     * @expectedExceptionMessage At least one schema should be declare.
50
     */
51
    public function testGetSchemaNoSchemaFound()
52
    {
53
        $this->executor->getSchema('fake');
54
    }
55
56
    private function addSchema()
57
    {
58
        $queryType = new ObjectType([
59
            'name' => 'Query',
60
            'fields' => [
61
                'myField' => [
62
                    'type' => Type::boolean(),
63
                    'resolve' => function () {
64
                        return false;
65
                    },
66
                ],
67
            ],
68
        ]);
69
70
        $this->executor->addSchema('global', new Schema(['query' => $queryType]));
71
    }
72
}
73