Passed
Push — feature/95-gacela-file-in-diff... ( a19f90 )
by Chema
09:21
created

FeatureTest::tearDown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
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_config_from_custom_env_default(): 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_config_from_custom_env_dev(): void
33
    {
34
        self::markTestSkipped('TODO');
35
        putenv('APP_ENV=dev');
36
37
        Gacela::bootstrap(__DIR__);
38
39
        $facade = new LocalConfig\Facade();
40
41
        self::assertSame(
42
            [
43
                'key' => 'from:dev',
44
            ],
45
            $facade->doSomething()
46
        );
47
    }
48
49
    public function test_load_config_from_custom_env_prod(): void
50
    {
51
        self::markTestSkipped('TODO');
52
        putenv('APP_ENV=prod');
53
54
        Gacela::bootstrap(__DIR__);
55
56
        $facade = new LocalConfig\Facade();
57
58
        self::assertSame(
59
            [
60
                'key' => 'from:prod',
61
            ],
62
            $facade->doSomething()
63
        );
64
    }
65
}
66