1 | <?php |
||
18 | class ContainerTest extends AbstractHttpControllerTestCase |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Тестирование получения службы по контексту |
||
23 | * |
||
24 | * @return array |
||
25 | */ |
||
26 | public function dataTestGetEntryByContext() |
||
35 | |||
36 | |||
37 | /** |
||
38 | * Проверка ситуации когда пытаемся получить сервис, который: |
||
39 | * 1) Не может быть разрезолвен в другой, в зависимости от контекста |
||
40 | * 2) Не зарегестрирован в ServiceLocator приложения |
||
41 | * |
||
42 | * |
||
43 | * @expectedException \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
44 | * @expectedExceptionMessage Nnx\Container\Container::get was unable to fetch or create an instance for |
||
45 | * |
||
46 | * |
||
47 | * @return void |
||
48 | * |
||
49 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
50 | * @throws \Zend\Stdlib\Exception\LogicException |
||
51 | */ |
||
52 | public function testLoadModule() |
||
65 | |||
66 | |||
67 | /** |
||
68 | * Тестирование получени службы, в зависимости от контекста |
||
69 | * |
||
70 | * @dataProvider dataTestGetEntryByContext |
||
71 | * |
||
72 | * @param $entryName |
||
73 | * @param $context |
||
74 | * @param $expectedEntryClassName |
||
75 | * |
||
76 | * @throws \Zend\Stdlib\Exception\LogicException |
||
77 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
78 | */ |
||
79 | public function testGetEntryByContext($entryName, $context, $expectedEntryClassName) |
||
94 | } |
||
95 |
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: