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 ( 8f549c...6f6f6a )
by Jérémiah
11:28
created

ConfigExpressionProviderTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 7
c 2
b 0
f 1
lcom 1
cbo 3
dl 0
loc 51
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A testService() 0 7 1
A testParameter() 0 6 1
A testIsTypeOf() 0 4 1
A testNewObject() 0 4 1
A testFromGlobalId() 0 4 1
A testGlobalId() 0 4 1
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\Error;
13
14
use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionLanguage;
15
use Overblog\GraphQLBundle\Tests\DIContainerMockTrait;
16
17
class ConfigExpressionProviderTest extends \PHPUnit_Framework_TestCase
18
{
19
    use DIContainerMockTrait;
20
21
    /**
22
     * @var ExpressionLanguage
23
     */
24
    private $expressionLanguage;
25
26
    public function setUp()
27
    {
28
        $this->expressionLanguage = new ExpressionLanguage();
29
        $container = $this->getDIContainerMock();
30
        $this->expressionLanguage->setContainer($container);
31
    }
32
33
    public function testService()
34
    {
35
        $object = new \stdClass();
36
        $container = $this->getDIContainerMock(['toto' => $object]);
37
        $this->expressionLanguage->setContainer($container);
38
        $this->assertEquals($object, $this->expressionLanguage->evaluate('service("toto")'));
39
    }
40
41
    public function testParameter()
42
    {
43
        $container = $this->getDIContainerMock([], ['test' => 5]);
44
        $this->expressionLanguage->setContainer($container);
45
        $this->assertEquals(5, $this->expressionLanguage->evaluate('parameter("test")'));
46
    }
47
48
    public function testIsTypeOf()
49
    {
50
        $this->assertTrue($this->expressionLanguage->evaluate(sprintf('isTypeOf("%s")', 'stdClass'), ['value' => new \stdClass()]));
51
    }
52
53
    public function testNewObject()
54
    {
55
        $this->assertInstanceOf('stdClass', $this->expressionLanguage->evaluate(sprintf('newObject("%s")', 'stdClass')));
56
    }
57
58
    public function testFromGlobalId()
59
    {
60
        $this->assertEquals(['type' => 'User', 'id' => 15], $this->expressionLanguage->evaluate('fromGlobalId("VXNlcjoxNQ==")'));
61
    }
62
63
    public function testGlobalId()
64
    {
65
        $this->assertEquals('VXNlcjoxNQ==', $this->expressionLanguage->evaluate('globalId(15, "User")'));
66
    }
67
}
68