Passed
Push — feature/95-gacela-file-in-diff... ( a19f90...caf7a9 )
by Chema
03:40
created

FeatureTest::test_load_gacela_dev_file()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 13
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Framework\UsingGacelaFileFromCustomEnv;
6
7
use Gacela\Framework\Gacela;
8
use PHPUnit\Framework\TestCase;
9
10
final class FeatureTest extends TestCase
11
{
12
    public function tearDown(): void
13
    {
14
        # Remove the APP_ENV
15
        putenv('APP_ENV');
16
    }
17
18
    public function test_load_gacela_default_file(): void
19
    {
20
        Gacela::bootstrap(__DIR__);
21
22
        $facade = new LocalConfig\Facade();
23
24
        self::assertSame(
25
            [
26
                'key' => 'from:default',
27
            ],
28
            $facade->doSomething()
29
        );
30
    }
31
32
    public function test_load_gacela_dev_file(): void
33
    {
34
        putenv('APP_ENV=dev');
35
36
        Gacela::bootstrap(__DIR__);
37
38
        $facade = new LocalConfig\Facade();
39
40
        self::assertSame(
41
            [
42
                'key' => 'from:dev',
43
            ],
44
            $facade->doSomething()
45
        );
46
    }
47
48
    public function test_load_gacela_prod_file(): void
49
    {
50
        putenv('APP_ENV=prod');
51
52
        Gacela::bootstrap(__DIR__);
53
54
        $facade = new LocalConfig\Facade();
55
56
        self::assertSame(
57
            [
58
                'key' => 'from:prod',
59
            ],
60
            $facade->doSomething()
61
        );
62
    }
63
}
64