GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 0dd51f...bd31e6 )
by Benjamin
02:53
created

DotenvParserTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 37
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A envVarsProvider() 0 8 1
A testDataIsParsed() 0 4 1
A setUp() 0 4 1
A testValuesAreCorrect() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * Created by PhpStorm.
6
 * User: benjamin
7
 * Date: 26/01/19
8
 * Time: 14:54.
9
 */
10
11
namespace Tests\Lib\Env\Parser;
12
13
use Lib\Env\Parser\DotenvParser;
14
use PHPUnit\Framework\TestCase;
15
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()
46
    {
47
        return [
48
            ['TEST_UNQUOTED_VALUE', 'foo'],
49
            ['TEST_QUOTED_VALUE', 'This value contains spaces'],
50
            ['TEST_UNQUOTED_SPECIAL_CHAR', '$fjhs|%::saqzrfgs#foo'],
51
            ['TEST_QUOTED_SPECIAL_CHARS', 'dg$ag,k@zrg%|qwdf#qsf'],
52
            ['TEST_STRIPPED_COMMENT', 'foo'],
53
        ];
54
    }
55
}
56