Skip to content

Commit 92e9783

Browse files
Daniel StokesGrahamCampbell
authored andcommitted
added test case to cover parse error
1 parent b971ca9 commit 92e9783

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/Dotenv/ParserTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,18 @@ public function testParseInvalidName()
4646
{
4747
Parser::parse('FOO_ASD!=BAZ');
4848
}
49+
50+
/**
51+
* @expectedException \Dotenv\Exception\InvalidFileException
52+
* @expectedExceptionMessageRegExp /Failed to parse dotenv file due to a quote parsing error.+/
53+
*/
54+
public function testParserFailsWithException()
55+
{
56+
$default = 1000000;
57+
$limit = (int) ini_get('pcre.backtrack_limit');
58+
if($limit != $default) {
59+
$this->markTestIncomplete();
60+
}
61+
Parser::parse('FOO_BAD="iiiiviiiixiiiiviiii\\n"');
62+
}
4963
}

0 commit comments

Comments
 (0)