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

testEnvFileIsNotFoundWithWrongEnv()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
/**
5
 * Created by PhpStorm.
6
 * User: benjamin
7
 * Date: 26/01/19
8
 * Time: 12:10.
9
 */
10
11
namespace Tests\Lib\Env;
12
13
use Lib\Env\EnvVarsSetter;
14
use Lib\Env\Parser\DotenvParser;
15
use PHPUnit\Framework\MockObject\MockObject;
16
use PHPUnit\Framework\TestCase;
17
18
class EnvVarsSetterTest extends TestCase
19
{
20
    /** @var DotenvParser|MockObject */
21
    private $parser;
22
23
    /** @var EnvVarsSetter */
24
    private $setter;
25
26
    private $envPath = './tests/fixtures/.env';
27
28
    public function setUp()
29
    {
30
        $this->parser = $this->getMockBuilder(DotenvParser::class)
31
            ->setMethods(['parse'])
32
            ->getMock();
33
        $this->parser->method('parse')->willReturn(['TEST_FOO' => 'foo']);
0 ignored issues
show
Bug introduced by
The method method() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

33
        $this->parser->/** @scrutinizer ignore-call */ 
34
                       method('parse')->willReturn(['TEST_FOO' => 'foo']);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
        $this->setter = new EnvVarsSetter($this->parser);
35
    }
36
37
    public function testEnvFileIsNotFoundWithWrongEnv()
38
    {
39
        $this->setter->loadEnv($this->envPath);
40
        $this->assertFalse(getenv('TEST_FOO'));
41
    }
42
43
    public function testEnvFileIsFoundWithEnv()
44
    {
45
        $this->setter->loadEnv($this->envPath, 'APP_ENV', 'test');
46
        $this->assertEquals('foo', getenv('TEST_FOO'));
47
    }
48
}
49