@@ -22,7 +22,6 @@ public function testLoadPutenv()
22
22
$ this ->assertEquals ('"6" ' , getenv ('f ' ), 'Escaped numeric string ' );
23
23
$ this ->assertEquals ('one_two ' , getenv ('1_2 ' ), 'Underscored string ' );
24
24
$ this ->assertEquals ('Apple Ball ' , getenv ('A_B ' ), 'Multi word string ' );
25
- $ this ->assertEquals ("line 1 \nline 2 " , getenv ('MUL ' ), 'Multi line string ' );
26
25
27
26
$ this ->assertFalse (getenv ('MuL ' ), 'Key should be case sensitive ' );
28
27
@@ -47,7 +46,6 @@ public function testLoadGlobals()
47
46
$ this ->assertEquals ('"6" ' , $ source ['f ' ], 'Escaped numeric string ' );
48
47
$ this ->assertEquals ('one_two ' , $ source ['1_2 ' ], 'Underscored string ' );
49
48
$ this ->assertEquals ('Apple Ball ' , $ source ['A_B ' ], 'Multi word string ' );
50
- $ this ->assertEquals ("line 1 \nline 2 " , $ source ['MUL ' ], 'Multi line string ' );
51
49
52
50
$ this ->assertArrayNotHasKey ('mUl ' , $ source , 'Key should be case sensitive ' );
53
51
}
@@ -71,7 +69,6 @@ public function testLoadOverrideAll()
71
69
$ this ->assertEquals ('o$3# ' , getenv ('c ' ), 'Unquoted string new ' );
72
70
$ this ->assertEquals ('olol ' , getenv ('d ' ), 'Quoted string new ' );
73
71
$ this ->assertEquals ('"o6" ' , getenv ('f ' ), 'Escaped numeric string new ' );
74
- $ this ->assertEquals ("oline 1 \nline 2 " , getenv ('MUL ' ), 'Multi line string new ' );
75
72
76
73
foreach (['SERVER ' , 'ENV ' ] as $ name ) {
77
74
$ source = $ name === 'ENV ' ? $ _ENV : $ _SERVER ;
@@ -81,17 +78,24 @@ public function testLoadOverrideAll()
81
78
$ this ->assertNotEquals ('$3# ' , $ source ['c ' ], 'Unquoted string old ' );
82
79
$ this ->assertNotEquals ('lol ' , $ source ['d ' ], 'Quoted string old ' );
83
80
$ this ->assertNotEquals ('"6" ' , $ source ['f ' ], 'Escaped numeric string old ' );
84
- $ this ->assertNotEquals ("line 1 \nline 2 " , $ source ['MUL ' ], 'Multi line string old ' );
85
81
86
82
$ this ->assertEquals ('o1 ' , $ source ['a ' ], 'Unquoted number new ' );
87
83
$ this ->assertEquals ('o2 ' , $ source ['b ' ], 'Quoted number new ' );
88
84
$ this ->assertEquals ('o$3# ' , $ source ['c ' ], 'Unquoted string new ' );
89
85
$ this ->assertEquals ('olol ' , $ source ['d ' ], 'Quoted string new ' );
90
86
$ this ->assertEquals ('"o6" ' , $ source ['f ' ], 'Escaped numeric string new ' );
91
- $ this ->assertEquals ("oline 1 \nline 2 " , $ source ['MUL ' ], 'Multi line string new ' );
92
87
}
93
88
}
94
89
90
+ public function testRef ()
91
+ {
92
+ (new Loader )->load (__DIR__ . '/stubs/ref.env ' );
93
+
94
+ $ this ->assertSame ('1/2 ' , getenv ('REF ' ));
95
+ $ this ->assertSame ('1/2/3 ' , getenv ('REF2 ' ));
96
+ $ this ->assertSame ('${INV} ' , getenv ('REF3 ' ));
97
+ }
98
+
95
99
/**
96
100
* @expectedException \InvalidArgumentException
97
101
* @expectedExceptionMessage The .env file does not exist or is not readable
0 commit comments