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.
Completed
Push — master ( b24d9c...5b3f55 )
by Dmitry
02:27
created

ConfigTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 37
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testConfig() 0 10 1
A testCache() 0 19 1
1
<?php
2
3
use Silex\Application;
4
use Junker\Silex\Provider\YamlConfigurationServiceProvider;
5
6
7
class ConfigTest extends \PHPUnit_Framework_TestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
    const CONFIG_FILE = __DIR__ . '/../res/config.yml';
10
    const CACHE_PATH = '/tmp/cache_config_123634f3d';
11
12
    public function testConfig()
13
    {
14
        $app = new Application();
15
16
        $app->register(new YamlConfigurationServiceProvider(self::CONFIG_FILE));
17
18
        $this->assertEquals($app['config']['db']['pass'], '123123');
19
        $this->assertEquals($app['config']['facebook']['debug'], true);
20
        $this->assertEquals(count($app['config']['security']['rules']['IS_AUTHENTICATED_ANONYMOUSLY']), 2);
21
    }
22
23
    public function testCache()
24
    {
25
        $app = new Application();
26
27
        system("rm -rf " . escapeshellarg(self::CACHE_PATH));
28
29
        $app->register(new YamlConfigurationServiceProvider(self::CONFIG_FILE, ['cache_dir' => self::CACHE_PATH]));
30
31
        $this->assertEquals($app['config']['db']['pass'], '123123');
32
33
        $this->assertFileExists(self::CACHE_PATH . '/config.cache.php');
34
        $this->assertFileExists(self::CACHE_PATH . '/config.cache.php.meta');
35
36
        $app = new Application();
37
38
        $app->register(new YamlConfigurationServiceProvider(self::CONFIG_FILE, ['cache_dir' => self::CACHE_PATH]));
39
40
        $this->assertEquals($app['config']['db']['pass'], '123123');
41
    }
42
43
}
44