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.

testCreateHydratorFileCreatesFile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Tests\Lib\DB\ORM;
6
7
use Lib\DB\ORM\HydratorDecoratorFactory;
8
use Lib\Routing\RouteDefinition;
9
use PHPUnit\Framework\TestCase;
10
11
class HydratorDecoratorFactoryTest extends TestCase
12
{
13
    /** @var HydratorDecoratorFactory */
14
    private $factory;
15
16
    public function setUp()
17
    {
18
        $this->factory = new HydratorDecoratorFactory();
19
    }
20
21
    public function testCreateHydratorFileCreatesFile()
22
    {
23
        $file = __DIR__.'/../../../../../../var/cache/tests/RouteDefinitionHydratorDecorator.php';
24
        $hydratorClass = 'RouteDefinitionHydratorDecorator';
25
26
        $this->factory->createHydratorFile(RouteDefinition::class, $hydratorClass, $file);
27
        include $file;
28
        $hydrator = new $hydratorClass('home', '/');
29
30
        $this->assertTrue(file_exists($file));
31
        $this->assertInstanceOf(RouteDefinition::class, $hydrator);
32
    }
33
34
    public function testCreateHydratorForClassCreatesHydrator()
35
    {
36
        $hydratorClass = 'RouteDefinitionHydratorDecorator';
37
38
        $this->factory->createHydratorForClass(RouteDefinition::class, ['home', '/']);
39
        $hydrator = new $hydratorClass('home', '/');
40
41
        $this->assertInstanceOf(RouteDefinition::class, $hydrator);
42
    }
43
44
    public function testGetHydratorForClassReturnsPreviouslyInstanciatedHydrator()
45
    {
46
        $hydrator = $this->factory->getHydratorForClass(RouteDefinition::class, ['home', '/']);
47
48
        $this->assertInstanceOf(RouteDefinition::class, $hydrator);
49
    }
50
51
    public function testGetHydratorForClassWithObjectAsArg()
52
    {
53
        $hydrator = $this->factory->getHydratorForClass(new RouteDefinition('home', '/'), ['home', '/']);
54
55
        $this->assertInstanceOf(RouteDefinition::class, $hydrator);
56
    }
57
}
58