1 | <?php |
||
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 |