Total Complexity | 4 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class DotenvParserTest extends TestCase |
||
17 | { |
||
18 | /** @var string */ |
||
19 | private $data; |
||
20 | |||
21 | /** @var DotenvParser */ |
||
22 | private $parser; |
||
23 | |||
24 | public function setUp() |
||
25 | { |
||
26 | $this->data = file_get_contents('./tests/fixtures/.env.test'); |
||
27 | $this->parser = new DotenvParser(); |
||
28 | } |
||
29 | |||
30 | public function testDataIsParsed() |
||
31 | { |
||
32 | $result = $this->parser->parse($this->data); |
||
33 | $this->assertIsArray($result); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @dataProvider envVarsProvider |
||
38 | */ |
||
39 | public function testValuesAreCorrect($name, $value) |
||
40 | { |
||
41 | $result = $this->parser->parse($this->data); |
||
42 | $this->assertEquals($result[$name], $value); |
||
43 | } |
||
44 | |||
45 | public function envVarsProvider() |
||
53 | ]; |
||
54 | } |
||
55 | } |
||
56 |