Completed
Push — develop ( 7f6ad2...eb155e )
by Baptiste
02:38
created

MapFactoryTest::testMake()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 3
crap 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Tests\Innmind\Neo4jBundle\Factory;
5
6
use Innmind\Neo4jBundle\Factory\MapFactory;
7
use Innmind\Neo4j\ONM\Translation\{
8
    ResultTranslator,
9
    EntityTranslatorInterface,
10
    IdentityMatchTranslator,
11
    IdentityMatchTranslatorInterface,
12
    MatchTranslator,
13
    MatchTranslatorInterface,
14
    SpecificationTranslator,
15
    SpecificationTranslatorInterface
16
};
17
18
class MapFactoryTest extends \PHPUnit_Framework_TestCase
19
{
20
    /**
21
     * @dataProvider factories
22
     */
23
    public function testMake(string $class, string $type, array $argument)
24
    {
25
        $r = MapFactory::make($class, $type, $argument);
26
27
        $this->assertInstanceOf($class, $r);
28
    }
29
30
    public function factories()
31
    {
32
        return [
33
            [
34
                ResultTranslator::class,
35
                EntityTranslatorInterface::class,
36
                [
37
                    'foo' => $this->getMock(EntityTranslatorInterface::class),
38
                ],
39
            ],
40
            [
41
                IdentityMatchTranslator::class,
42
                IdentityMatchTranslatorInterface::class,
43
                [
44
                    'foo' => $this->getMock(IdentityMatchTranslatorInterface::class),
45
                ],
46
            ],
47
            [
48
                MatchTranslator::class,
49
                MatchTranslatorInterface::class,
50
                [
51
                    'foo' => $this->getMock(MatchTranslatorInterface::class),
52
                ],
53
            ],
54
            [
55
                SpecificationTranslator::class,
56
                SpecificationTranslatorInterface::class,
57
                [
58
                    'foo' => $this->getMock(SpecificationTranslatorInterface::class),
59
                ],
60
            ],
61
        ];
62
    }
63
}
64