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

MutationResolverTest::setUpBeforeClass()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 18
rs 9.4285
cc 2
eloc 10
nc 2
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\MutationResolver;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Definition;
17
18
class MutationResolverTest extends \PHPUnit_Framework_TestCase
19
{
20
    /** @var  ContainerBuilder */
21
    private static $container;
22
23
    /** @var  MutationResolver */
24
    private static $mutationResolver;
25
26
    public static function setUpBeforeClass()
27
    {
28
        $container = new ContainerBuilder();
29
30
        $mapping = [
31
            'Toto' => ['id' => 'overblog_graphql.definition.custom_toto_mutation', 'alias' => 'Toto', 'method' => 'resolveToto'],
32
            'Tata' => ['id' => 'overblog_graphql.definition.custom_tata_mutation', 'alias' => 'Tata', 'method' => 'resolveTata'],
33
        ];
34
35
        $container->setParameter('overblog_graphql.mutations_mapping', $mapping);
36
37
        foreach ($mapping as $alias => $options) {
38
            $container->setDefinition($options['id'], new Definition(sprintf('%s\\%sMutation', __NAMESPACE__, $alias)));
39
        }
40
41
        self::$container = $container;
42
        self::$mutationResolver = new MutationResolver(self::$container);
43
    }
44
45
    public function testResolveKnownMutation()
46
    {
47
        $result = self::$mutationResolver->resolve(['Toto', ['my', 'resolve', 'test']]);
48
49
        $this->assertEquals(['my', 'resolve', 'test'], $result);
50
    }
51
52
    /**
53
     * @expectedException \Overblog\GraphQLBundle\Resolver\UnresolvableException
54
     */
55
    public function testResolveUnknownMutation()
56
    {
57
        self::$mutationResolver->resolve('Fake');
58
    }
59
}
60