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
Push — master ( b6fc5f...138f00 )
by Jérémiah
03:34
created

FieldResolverTest::testResolveUnknownField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
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 Overblog\GraphQLBundle\Resolver\FieldResolver;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Definition;
17
18
class FieldResolverTest extends \PHPUnit_Framework_TestCase
19
{
20
    /** @var  ContainerBuilder */
21
    private static $container;
22
23
    /** @var  FieldResolver */
24
    private static $fieldResolver;
25
26
    public static function setUpBeforeClass()
27
    {
28
        $container = new ContainerBuilder();
29
30
        $mapping = [
31
            'Toto' => ['id' => 'overblog_graphql.definition.custom_toto_field', 'alias' => 'Toto'],
32
            'Tata' => ['id' => 'overblog_graphql.definition.custom_tata_field', 'alias' => 'Tata'],
33
        ];
34
35
        $container->setParameter('overblog_graphql.fields_mapping', $mapping);
36
37
        foreach ($mapping as $alias => $options) {
38
            $container->setDefinition($options['id'], new Definition('stdClass'))
39
                ->setProperty('name', $alias);
40
        }
41
42
        self::$container = $container;
43
        self::$fieldResolver = new FieldResolver(self::$container);
44
    }
45
46
    public function testResolveKnownField()
47
    {
48
        $field = self::$fieldResolver->resolve('Toto');
49
50
        $this->assertInstanceOf('stdClass', $field);
51
        $this->assertEquals('Toto', $field->name);
52
    }
53
54
    /**
55
     * @expectedException \Overblog\GraphQLBundle\Resolver\UnresolvableException
56
     */
57
    public function testResolveUnknownField()
58
    {
59
        self::$fieldResolver->resolve('Fake');
60
    }
61
}
62