FeatureTest::test_load_default_config()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Framework\UsingConfigWithBootstrapSetup;
6
7
use Gacela\Framework\Bootstrap\GacelaConfig;
8
use Gacela\Framework\Gacela;
9
use PHPUnit\Framework\TestCase;
10
11
final class FeatureTest extends TestCase
12
{
13
    protected function setUp(): void
14
    {
15
        $configFn = static function (GacelaConfig $config): void {
16
            $config->resetInMemoryCache();
17
            $config->addAppConfig('custom-config.php', 'custom-config_local.php');
18
        };
19
20
        Gacela::bootstrap(__DIR__, $configFn);
21
    }
22
23
    public function test_load_default_config(): void
24
    {
25
        $facade = new LocalConfig\Facade();
26
27
        self::assertSame(
28
            [
29
                'config' => 1,
30
                'config_local' => 2,
31
                'override' => 5,
32
            ],
33
            $facade->doSomething(),
34
        );
35
    }
36
}
37