GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DeviceDetectTest::toggleWithAndWithoutAppConfig()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace CrossKnowledge\DeviceDetectBundle\Tests\Services;
4
5
use CrossKnowledge\DeviceDetectBundle\DependencyInjection\CrossKnowledgeDeviceDetectExtension;
6
use Symfony\Component\Config\FileLocator;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
9
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
10
11
class DeviceDetectTest extends \PHPUnit_Framework_TestCase
12
{
13
    protected function createContainer($loadAppFile)
14
    {
15
        $extension = new CrossKnowledgeDeviceDetectExtension();
16
        $container = new ContainerBuilder(new ParameterBag(['kernel.cache_dir' => __DIR__.'/fixtures']));
17
        $container->registerExtension($extension);
18
19
        if ($loadAppFile) {
20
            $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/fixtures'));
21
            $loader->load('config.yml');
22
        } else {
23
            $extension->load([], $container);
24
        }
25
26
        $container->getCompilerPassConfig()->setRemovingPasses(array());
27
        $container->compile();
28
29
        return $container;
30
    }
31
32
    public function toggleWithAndWithoutAppConfig()
33
    {
34
        return [
35
            [true, 'crossknowledge.example_cache_override'],
36
            [false, 'crossknowledge.default_cache_manager'],
37
        ];
38
    }
39
    /**
40
     * @dataProvider toggleWithAndWithoutAppConfig
41
     */
42
    public function testCacheManagerDefaultIsOverridable($configLoaded, $expectedServicename)
43
    {
44
        $container = $this->createContainer($configLoaded);
45
        $definition = $container->getDefinition('crossknowledge.device_detect');
46
        $arguments = $definition->getArguments();
47
48
        $this->assertEquals(
49
            $expectedServicename,
50
            (string)$arguments[1],
51
            'Once the option cache_manager is '.($configLoaded ? 'set' : 'not set').', the service must be overriden'
52
        );
53
    }
54
55
}