Conditions | 2 |
Paths | 2 |
Total Lines | 34 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function testGet($messageName, $success) |
||
21 | { |
||
22 | $callableService = $this->getMockBuilder('CallableService') |
||
23 | ->setMethods(['execute', 'getMethod']); |
||
24 | |||
25 | |||
26 | $container = $this->createMock(ContainerInterface::class); |
||
27 | $container->expects($this->any()) |
||
28 | ->method('get') |
||
29 | ->will($this->returnValue($callableService)); |
||
30 | |||
31 | |||
32 | $mapper = new ContainerCommandHandlerMapper($container, [ |
||
33 | 'message1' => [ |
||
34 | 'service' => 'service1', |
||
35 | 'method' => 'getMethod' |
||
36 | ], |
||
37 | 'message2' => [ |
||
38 | 'service' => 'service1', |
||
39 | 'method' => null |
||
40 | ], |
||
41 | 'message3' => [ |
||
42 | 'service' => 'service1', |
||
43 | 'method' => 'hui' |
||
44 | ], |
||
45 | ]); |
||
46 | |||
47 | |||
48 | if (!$success) { |
||
49 | $this->expectException(HandlerNotFoundException::class); |
||
50 | } |
||
51 | |||
52 | $mapper->get($messageName); |
||
53 | } |
||
54 | |||
65 |