Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function testProcess(): void |
||
30 | { |
||
31 | $definition = $this->createMock(Definition::class); |
||
32 | $definition->expects($this->once())->method('addMethodCall') |
||
33 | ->with('add', ['main']) |
||
34 | ; |
||
35 | |||
36 | $this->container->setDefinition('sonata.block.menu.registry', $definition); |
||
|
|||
37 | $this->container->setParameter('core23_menu.groups', [ |
||
38 | 'main' => [ |
||
39 | 'name' => 'FooMenu', |
||
40 | 'attributes' => [ |
||
41 | 'class' => 'my-class', |
||
42 | ], |
||
43 | 'items' => [], |
||
44 | ], |
||
45 | ]); |
||
46 | |||
47 | $compiler = new MenuCompilerPass(); |
||
48 | $compiler->process($this->container); |
||
49 | } |
||
50 | |||
62 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: