FeatureTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A test_load_multiple_config_files() 0 12 1
A setUp() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Framework\UsingMultipleConfig;
6
7
use Gacela\Framework\Bootstrap\GacelaConfig;
8
use Gacela\Framework\Gacela;
9
use GacelaTest\Fixtures\SimpleEnvConfigReader;
10
use PHPUnit\Framework\TestCase;
11
12
final class FeatureTest extends TestCase
13
{
14
    protected function setUp(): void
15
    {
16
        Gacela::bootstrap(__DIR__, static function (GacelaConfig $config): void {
17
            $config
18
                ->resetInMemoryCache()
19
                ->addAppConfig('config/.env*', '', SimpleEnvConfigReader::class)
20
                ->addAppConfig('config/*.php');
21
        });
22
    }
23
24
    public function test_load_multiple_config_files(): void
25
    {
26
        $facade = new LocalConfig\Facade();
27
28
        self::assertSame(
29
            [
30
                'config-env' => 1,
31
                'config-php' => 3,
32
                'override' => 4,
33
                'local' => 5,
34
            ],
35
            $facade->doSomething(),
36
        );
37
    }
38
}
39