Passed
Push — master ( fdae84...25d981 )
by Aleksei
08:01
created

JsonLoaderTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 9
dl 0
loc 23
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Spiral Framework.
5
 *
6
 * @license   MIT
7
 * @author    Anton Titov (Wolfy-J)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Spiral\Tests\Config;
13
14
use Spiral\Config\Exception\LoaderException;
15
16
class JsonLoaderTest extends BaseTest
17
{
18
    public function testGetConfig(): void
19
    {
20
        $cf = $this->getFactory();
21
22
        $this->assertEquals(['name' => 'value'], $cf->getConfig('json'));
23
    }
24
25
    public function testEmpty(): void
26
    {
27
        $this->expectException(LoaderException::class);
28
29
        $cf = $this->getFactory();
30
        $cf->getConfig('empty-json');
31
    }
32
33
    public function testBroken(): void
34
    {
35
        $this->expectException(LoaderException::class);
36
37
        $cf = $this->getFactory();
38
        $cf->getConfig('broken-json');
39
    }
40
}
41