@@ -22,7 +22,6 @@ public function testLoadPutenv()
2222 $ this ->assertEquals ('"6" ' , getenv ('f ' ), 'Escaped numeric string ' );
2323 $ this ->assertEquals ('one_two ' , getenv ('1_2 ' ), 'Underscored string ' );
2424 $ this ->assertEquals ('Apple Ball ' , getenv ('A_B ' ), 'Multi word string ' );
25- $ this ->assertEquals ("line 1 \nline 2 " , getenv ('MUL ' ), 'Multi line string ' );
2625
2726 $ this ->assertFalse (getenv ('MuL ' ), 'Key should be case sensitive ' );
2827
@@ -47,7 +46,6 @@ public function testLoadGlobals()
4746 $ this ->assertEquals ('"6" ' , $ source ['f ' ], 'Escaped numeric string ' );
4847 $ this ->assertEquals ('one_two ' , $ source ['1_2 ' ], 'Underscored string ' );
4948 $ this ->assertEquals ('Apple Ball ' , $ source ['A_B ' ], 'Multi word string ' );
50- $ this ->assertEquals ("line 1 \nline 2 " , $ source ['MUL ' ], 'Multi line string ' );
5149
5250 $ this ->assertArrayNotHasKey ('mUl ' , $ source , 'Key should be case sensitive ' );
5351 }
@@ -71,7 +69,6 @@ public function testLoadOverrideAll()
7169 $ this ->assertEquals ('o$3# ' , getenv ('c ' ), 'Unquoted string new ' );
7270 $ this ->assertEquals ('olol ' , getenv ('d ' ), 'Quoted string new ' );
7371 $ this ->assertEquals ('"o6" ' , getenv ('f ' ), 'Escaped numeric string new ' );
74- $ this ->assertEquals ("oline 1 \nline 2 " , getenv ('MUL ' ), 'Multi line string new ' );
7572
7673 foreach (['SERVER ' , 'ENV ' ] as $ name ) {
7774 $ source = $ name === 'ENV ' ? $ _ENV : $ _SERVER ;
@@ -81,17 +78,24 @@ public function testLoadOverrideAll()
8178 $ this ->assertNotEquals ('$3# ' , $ source ['c ' ], 'Unquoted string old ' );
8279 $ this ->assertNotEquals ('lol ' , $ source ['d ' ], 'Quoted string old ' );
8380 $ this ->assertNotEquals ('"6" ' , $ source ['f ' ], 'Escaped numeric string old ' );
84- $ this ->assertNotEquals ("line 1 \nline 2 " , $ source ['MUL ' ], 'Multi line string old ' );
8581
8682 $ this ->assertEquals ('o1 ' , $ source ['a ' ], 'Unquoted number new ' );
8783 $ this ->assertEquals ('o2 ' , $ source ['b ' ], 'Quoted number new ' );
8884 $ this ->assertEquals ('o$3# ' , $ source ['c ' ], 'Unquoted string new ' );
8985 $ this ->assertEquals ('olol ' , $ source ['d ' ], 'Quoted string new ' );
9086 $ this ->assertEquals ('"o6" ' , $ source ['f ' ], 'Escaped numeric string new ' );
91- $ this ->assertEquals ("oline 1 \nline 2 " , $ source ['MUL ' ], 'Multi line string new ' );
9287 }
9388 }
9489
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+
9599 /**
96100 * @expectedException \InvalidArgumentException
97101 * @expectedExceptionMessage The .env file does not exist or is not readable
0 commit comments