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 ( ce99bb...731744 )
by Cees-Jan
05:08
created

AbstractEmptyResourceTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 39
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
getSyncAsync() 0 1 ?
getClass() 0 1 ?
A provideProperties() 0 11 2
A testProperties() 0 18 4
1
<?php
2
declare(strict_types=1);
3
4
namespace ApiClients\Tools\ResourceTestUtilities;
5
6
use phpDocumentor\Reflection\DocBlock;
7
use ReflectionClass;
8
use Throwable;
9
use TypeError;
10
11
abstract class AbstractEmptyResourceTest extends TestCase
12
{
13
    abstract public function getSyncAsync(): string;
14
    abstract public function getClass(): string;
15
16
    public function provideProperties(): array
17
    {
18
        $yield = [];
19
        $class = new ReflectionClass($this->getClass());
20
21
        foreach ($class->getMethods() as $method) {
22
            $yield[] = [$method->getName()];
0 ignored issues
show
Bug introduced by
Consider using $method->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
23
        }
24
25
        return [[$yield]];
26
    }
27
28
    /**
29
     * @dataProvider provideProperties
30
     */
31
    public function testProperties($args)
32
    {
33
        $class = $this->getClass();
34
        $resource = new $class();
35
36
        foreach ($args as $arg) {
37
            list ($method) = $arg;
38
39
            try {
40
                $resource->{$method}();
41
            } catch (TypeError $e) {
42
                self::assertTrue(true);
43
                continue;
44
            } catch (Throwable $t) {
45
                self::fail('Should have thrown a TypeError instead of a ' . get_class($t));
46
            }
47
        }
48
    }
49
}
50