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

FeatureTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 19
c 2
b 0
f 0
dl 0
loc 51
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 4 1
A test_load_gacela_prod_file() 0 13 1
A test_load_gacela_dev_file() 0 13 1
A test_load_gacela_default_file() 0 11 1
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