FeatureTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 12 1
A test_application_config_are_added_from_gacela_config() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Framework\GacelaConfigAddAppConfigKeyValues;
6
7
use Gacela\Framework\Bootstrap\GacelaConfig;
8
use Gacela\Framework\Gacela;
9
use GacelaTest\Feature\Framework\GacelaConfigAddAppConfigKeyValues\Module\Facade;
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->addAppConfigKeyValue('first_key', 'individual config key-value');
18
19
            $config->addAppConfigKeyValues([
20
                'some_key' => 'some value',
21
                'another_key' => 'another value',
22
                'override_key' => 'i am going to be overrided',
23
            ]);
24
25
            $config->addAppConfigKeyValue('override_key', 'truly override'); // it overrides previous 'override_key' key
26
        });
27
    }
28
29
    public function test_application_config_are_added_from_gacela_config(): void
30
    {
31
        $facade = new Facade();
32
33
        self::assertSame([
34
            'first_key' => 'individual config key-value',
35
            'some_key' => 'some value',
36
            'another_key' => 'another value',
37
            'override_key' => 'truly override',
38
        ], $facade->getConfigData());
39
    }
40
}
41