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.

AccessPropertyTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 1
Metric Value
eloc 21
dl 0
loc 49
rs 10
c 4
b 0
f 1
wmc 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testAccessProperty() 0 5 1
A testThrowWhenPropertyNotFound() 0 6 1
cases() 0 28 ?
A hp$4 ➔ cases() 0 28 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Tests\Innmind\Reflection\Visitor;
5
6
use Innmind\Reflection\{
7
    Visitor\AccessProperty,
8
    Exception\PropertyNotFound,
9
};
10
use Fixtures\Innmind\Reflection\Foo;
11
use PHPUnit\Framework\TestCase;
12
13
class AccessPropertyTest extends TestCase
14
{
15
    /**
16
     * @dataProvider cases
17
     */
18
    public function testAccessProperty($object, string $property)
19
    {
20
        $this->assertInstanceOf(
21
            \ReflectionProperty::class,
22
            (new AccessProperty)($object, $property)
23
        );
24
    }
25
26
    public function testThrowWhenPropertyNotFound()
27
    {
28
        $this->expectException(PropertyNotFound::class);
29
        $this->expectExceptionMessage('foo');
30
31
        (new AccessProperty)(new \stdClass, 'foo');
32
    }
33
34
    public function cases(): array
35
    {
36
        return [
37
            [
38
                new class {
39
                    public $foo;
40
                },
41
                'foo',
42
            ],
43
            [
44
                new class {
45
                    protected $foo;
46
                },
47
                'foo',
48
            ],
49
            [
50
                new class {
51
                    private $foo;
0 ignored issues
show
introduced by
The private property $foo is not used, and could be removed.
Loading history...
52
                },
53
                'foo',
54
            ],
55
            [
56
                new class extends Foo {},
57
                'someProperty',
58
            ],
59
            [
60
                new class extends Foo {},
61
                'inheritProtected',
62
            ],
63
        ];
64
    }
65
}
66