File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,35 @@ public function testQuotesParse()
15
15
$ this ->assertSame (['FOO ' , "BAR \n" ], Parser::parse ("FOO= \"BAR \n\"" ));
16
16
}
17
17
18
+ public function testNewlineParse ()
19
+ {
20
+ $ this ->assertSame (['FOO ' , "\n" ], Parser::parse ('FOO="\n" ' ));
21
+ }
22
+
23
+ public function testTabParse ()
24
+ {
25
+ $ this ->assertSame (['FOO ' , "\t" ], Parser::parse ('FOO= \'\t \'' ));
26
+ }
27
+
28
+ public function testNonEscapeParse1 ()
29
+ {
30
+ $ this ->assertSame (['FOO ' , '\n\v ' ], Parser::parse ('FOO=\n\v ' ));
31
+ }
32
+
33
+ public function testNonEscapeParse2 ()
34
+ {
35
+ $ this ->assertSame (['FOO ' , '\q ' ], Parser::parse ('FOO=\q ' ));
36
+ }
37
+
38
+ /**
39
+ * @expectedException \Dotenv\Exception\InvalidFileException
40
+ * @expectedExceptionMessage Failed to parse dotenv file due to an unexpected escape sequence. Failed at ["\q"].
41
+ */
42
+ public function testBadEscapeParse ()
43
+ {
44
+ Parser::parse ('FOO="\q" ' );
45
+ }
46
+
18
47
public function testWhitespaceParse ()
19
48
{
20
49
$ this ->assertSame (['FOO ' , "\n" ], Parser::parse ("FOO= \"\n\"" ));
You can’t perform that action at this time.
0 commit comments