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::testCache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 10

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 19
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
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