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
Pull Request — master (#265)
by Jérémiah
23:39 queued 10:37
created

ServiceTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 4 1
A testService() 0 7 1
A getNames() 0 7 1
1
<?php
2
3
namespace Overblog\GraphQLBundle\Tests\ExpressionLanguage\ExpressionFunction\DependencyInjection;
4
5
use Overblog\GraphQLBundle\ExpressionLanguage\ExpressionFunction\DependencyInjection\Service;
6
use Overblog\GraphQLBundle\Tests\ExpressionLanguage\TestCase;
7
8
class ServiceTest extends TestCase
9
{
10
    protected function getFunctions()
11
    {
12
        return [new Service(), new Service('serv')];
13
    }
14
15
    /**
16
     * @param string $name
17
     * @dataProvider getNames
18
     */
19
    public function testService($name)
20
    {
21
        $object = new \stdClass();
22
        $container = $this->getDIContainerMock(['toto' => $object]);
23
        $this->expressionLanguage->setContainer($container);
24
        $this->assertEquals($object, eval('return '.$this->expressionLanguage->compile($name.'("toto")').';'));
0 ignored issues
show
Coding Style introduced by
It is generally not recommended to use eval unless absolutely required.

On one hand, eval might be exploited by malicious users if they somehow manage to inject dynamic content. On the other hand, with the emergence of faster PHP runtimes like the HHVM, eval prevents some optimization that they perform.

Loading history...
25
    }
26
27
    public function getNames()
28
    {
29
        return [
30
            ['service'],
31
            ['serv'],
32
        ];
33
    }
34
}
35