| @@ 10-16 (lines=7) @@ | ||
| 7 | /** |
|
| 8 | * @test |
|
| 9 | */ |
|
| 10 | public function it_can_find_an_environment_varaible_in_a_dot_env_file() |
|
| 11 | { |
|
| 12 | file_put_contents("{$this->path}/.env", 'FOOBAR=BAZ'); |
|
| 13 | $result = $this->envFinder->getFromFile("{$this->path}/.env"); |
|
| 14 | $this->assertCount(1, $result); |
|
| 15 | $this->assertEquals('FOOBAR', $result[0]); |
|
| 16 | } |
|
| 17 | ||
| 18 | /** |
|
| 19 | * @test |
|
| @@ 21-28 (lines=8) @@ | ||
| 18 | /** |
|
| 19 | * @test |
|
| 20 | */ |
|
| 21 | public function it_can_find_multiple_environment_varaibles_in_a_dot_env_file() |
|
| 22 | { |
|
| 23 | file_put_contents("{$this->path}/.env", "FOOBAR=BAZ\nBAZBAR=FOO"); |
|
| 24 | $result = $this->envFinder->getFromFile("{$this->path}/.env"); |
|
| 25 | $this->assertCount(2, $result); |
|
| 26 | $this->assertEquals('FOOBAR', $result[0]); |
|
| 27 | $this->assertEquals('BAZBAR', $result[1]); |
|
| 28 | } |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @test |
|
| @@ 43-49 (lines=7) @@ | ||
| 40 | /** |
|
| 41 | * @test |
|
| 42 | */ |
|
| 43 | public function it_can_find_an_environment_varaible_in_a_dot_env_example_file() |
|
| 44 | { |
|
| 45 | file_put_contents("{$this->path}/.env.example", 'FOOBAR=BAZ'); |
|
| 46 | $result = $this->envFinder->getFromFile("{$this->path}/.env.example"); |
|
| 47 | $this->assertCount(1, $result); |
|
| 48 | $this->assertEquals('FOOBAR', $result[0]); |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @test |
|
| @@ 54-61 (lines=8) @@ | ||
| 51 | /** |
|
| 52 | * @test |
|
| 53 | */ |
|
| 54 | public function it_can_find_multiple_environment_varaibles_in_a_dot_env_example_file() |
|
| 55 | { |
|
| 56 | file_put_contents("{$this->path}/.env.example", "FOOBAR=BAZ\nBAZBAR=FOO"); |
|
| 57 | $result = $this->envFinder->getFromFile("{$this->path}/.env.example"); |
|
| 58 | $this->assertCount(2, $result); |
|
| 59 | $this->assertEquals('FOOBAR', $result[0]); |
|
| 60 | $this->assertEquals('BAZBAR', $result[1]); |
|
| 61 | } |
|
| 62 | ||
| 63 | /** |
|
| 64 | * @test |
|
| @@ 76-82 (lines=7) @@ | ||
| 73 | /** |
|
| 74 | * @test |
|
| 75 | */ |
|
| 76 | public function it_can_find_an_environment_varaible_in_a_php_file() |
|
| 77 | { |
|
| 78 | file_put_contents("{$this->path}/foobar.php", "env('FOOBAR');"); |
|
| 79 | $result = $this->envFinder->getFromFile("{$this->path}/foobar.php"); |
|
| 80 | $this->assertCount(1, $result); |
|
| 81 | $this->assertEquals('FOOBAR', $result[0]); |
|
| 82 | } |
|
| 83 | ||
| 84 | /** |
|
| 85 | * @test |
|
| @@ 87-94 (lines=8) @@ | ||
| 84 | /** |
|
| 85 | * @test |
|
| 86 | */ |
|
| 87 | public function it_can_find_multiple_environment_varaibles_in_a_php_file() |
|
| 88 | { |
|
| 89 | file_put_contents("{$this->path}/foobar.php", "env('FOOBAR'); env('BARBAZ');"); |
|
| 90 | $result = $this->envFinder->getFromFile("{$this->path}/foobar.php"); |
|
| 91 | $this->assertCount(2, $result); |
|
| 92 | $this->assertEquals('FOOBAR', $result[0]); |
|
| 93 | $this->assertEquals('BARBAZ', $result[1]); |
|
| 94 | } |
|
| 95 | ||
| 96 | /** |
|
| 97 | * @test |
|