Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public function testRun() |
||
14 | { |
||
15 | $container = $this->prophesize(ContainerInterface::class); |
||
|
|||
16 | $kernelEvent = $this->prophesize(KernelEvent::class); |
||
17 | $container->get('executor_dummy') |
||
18 | ->willReturn(new ExecutorDummy()); |
||
19 | |||
20 | $container->has('executor_dummy') |
||
21 | ->willReturn(true); |
||
22 | |||
23 | $e = new Executor($container->reveal()); |
||
24 | $filter = new Filter([ |
||
25 | 'type' => Filter::TYPE_AFTER, |
||
26 | 'service' => 'executor_dummy', |
||
27 | 'method' => 'exec', |
||
28 | ]); |
||
29 | |||
30 | $result = $e->run($filter, $kernelEvent->reveal()); |
||
31 | $this->assertSame('call dummy exec method.', $result); |
||
32 | |||
33 | $container->get('executor_dummy')->shouldHaveBeenCalled(); |
||
34 | } |
||
35 | |||
47 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.