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
|
|
|
|