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.

testWriteValueDoesNotWriteIfSetterNotExists()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Lib\Access;
6
7
use Lib\Access\Accessor;
8
use Lib\Routing\RouteDefinition;
9
use PHPUnit\Framework\TestCase;
10
11
class AccessorTest extends TestCase
12
{
13
    private $accessor;
14
15
    public function setUp()
16
    {
17
        $this->accessor = new Accessor();
18
    }
19
20
    public function testReadValueReturnsCorrectValue()
21
    {
22
        $route = new RouteDefinition('home', '/');
23
24
        $valueGet = $this->accessor->readValue($route, 'name');
25
        $valueIs = $this->accessor->readValue($route, 'auth');
26
27
        $this->assertEquals('home', $valueGet);
28
        $this->assertEquals('', $valueIs);
29
    }
30
31
    public function testReadValueReturnsFalseIfWrongProp()
32
    {
33
        $route = new RouteDefinition('home', '/');
34
35
        $value = $this->accessor->readValue($route, 'blob');
36
37
        $this->assertFalse($value);
38
    }
39
40
    public function testWriteValueWritesIfSetterExists()
41
    {
42
        $route = new RouteDefinition('home', '/');
43
44
        $this->accessor->writeValue($route, 'defaults', ['foo' => 'bar']);
45
46
        $this->assertEquals(['foo' => 'bar'], $route->getDefaults());
47
    }
48
49
    public function testWriteValueDoesNotWriteIfSetterNotExists()
50
    {
51
        $route = new RouteDefinition('home', '/');
52
53
        $this->accessor->writeValue($route, 'name', 'foo');
54
55
        $this->assertEquals('home', $route->getName());
56
    }
57
}
58