FeatureTest::test_load_multiple_config_files()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 10
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