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.

HydratorDecoratorFactoryTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateHydratorFileCreatesFile() 0 11 1
A testGetHydratorForClassWithObjectAsArg() 0 5 1
A testGetHydratorForClassReturnsPreviouslyInstanciatedHydrator() 0 5 1
A setUp() 0 3 1
A testCreateHydratorForClassCreatesHydrator() 0 8 1
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