YamlConfigLoaderTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 1
Metric Value
wmc 2
eloc 11
c 4
b 1
f 1
dl 0
loc 18
ccs 13
cts 13
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testLoad() 0 7 1
A testCascadedLoad() 0 7 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/config project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Test\Config;
10
11
use Daikon\Config\YamlConfigLoader;
12
use PHPUnit\Framework\TestCase;
13
14
final class YamlConfigLoaderTest extends TestCase
15
{
16 1
    public function testLoad(): void
17
    {
18 1
        $yamlLoader = new YamlConfigLoader;
19 1
        $locations = [__DIR__.'/Fixture/YamlConfigLoader'];
20 1
        $sources = ['fixture.yml'];
21 1
        $expecation = require __DIR__.'/Fixture/YamlConfigLoader/load_expectation.php';
22 1
        $this->assertEquals($expecation, $yamlLoader->load($locations, $sources));
23 1
    }
24
25 1
    public function testCascadedLoad(): void
26
    {
27 1
        $yamlLoader = new YamlConfigLoader;
28 1
        $locations = [__DIR__.'/Fixture/YamlConfigLoader'];
29 1
        $sources = ['fixture*.yml'];
30 1
        $expecation = require __DIR__.'/Fixture/YamlConfigLoader/load_cascaded_expectation.php';
31 1
        $this->assertEquals($expecation, $yamlLoader->load($locations, $sources));
32 1
    }
33
}
34