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.
Completed
Push — master ( 53bcfa...6873de )
by SignpostMarv
03:59
created

dataProviderUndefinedPropertyException()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 29
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 29
rs 8.8571
c 0
b 0
f 0
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftObject\Tests;
8
9
use SignpostMarv\DaftObject\NudgesIncorrectly;
10
use SignpostMarv\DaftObject\ReadOnly;
11
use SignpostMarv\DaftObject\UndefinedPropertyException;
12
use SignpostMarv\DaftObject\WriteOnly;
13
14
class UndefinedPropertyExceptionTest extends TestCase
15
{
16
    public function dataProviderUndefinedPropertyException() : array
17
    {
18
        return [
19
            [
20
                ReadOnly::class,
21
                [
22
                    'nope' => 'foo',
23
                ],
24
                true,
25
                false,
26
                'nope',
27
            ],
28
            [
29
                WriteOnly::class,
30
                [
31
                    'nope' => 'foo',
32
                ],
33
                false,
34
                false,
35
                'nope',
36
            ],
37
            [
38
                NudgesIncorrectly::class,
39
                [
40
                    'Foo' => 'bar',
41
                ],
42
                true,
43
                true,
44
                'nope',
45
            ],
46
        ];
47
    }
48
49
    /**
50
    * @dataProvider dataProviderUndefinedPropertyException
51
    */
52
    public function testUndefinedPropertyException(
53
        string $implementation,
54
        array $args,
55
        bool $getNotSet,
56
        bool $writeAll,
57
        string $property
58
    ) : void {
59
        $this->expectException(UndefinedPropertyException::class);
60
        $this->expectExceptionMessage(
61
            sprintf(
62
                'Property not defined: %s::$%s',
63
                $implementation,
64
                $property
65
            )
66
        );
67
68
        $obj = new $implementation($args, $writeAll);
69
70
        if ($getNotSet) {
71
            $foo = $obj->$property;
0 ignored issues
show
Unused Code introduced by
The assignment to $foo is dead and can be removed.
Loading history...
72
        } else {
73
            $obj->$property = 1;
74
        }
75
    }
76
}
77