1 | <?php |
||
21 | class ModuleTest extends AbstractHttpControllerTestCase |
||
22 | { |
||
23 | /** |
||
24 | * Установка окружения |
||
25 | * |
||
26 | * @throws \Zend\Stdlib\Exception\LogicException |
||
27 | */ |
||
28 | public function setUp() |
||
37 | |||
38 | /** |
||
39 | * Проверка что модуль загружается |
||
40 | * |
||
41 | * @return void |
||
42 | */ |
||
43 | public function testLoadModule() |
||
47 | |||
48 | /** |
||
49 | * Проверка ситуации когда в модуль придет некорректный ModuleManager |
||
50 | * |
||
51 | * @expectedException \Nnx\Container\Exception\InvalidArgumentException |
||
52 | * @expectedExceptionMessage Module manager not implement Zend\ModuleManager\ModuleManager |
||
53 | * |
||
54 | * @throws \PHPUnit_Framework_Exception |
||
55 | * @throws \Nnx\Container\Exception\InvalidArgumentException |
||
56 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
57 | */ |
||
58 | public function testInvalidModuleManager() |
||
66 | |||
67 | |||
68 | |||
69 | /** |
||
70 | * Проверка ситуации когда не удается получить ServiceLocator |
||
71 | * |
||
72 | * @expectedException \Nnx\Container\Exception\InvalidArgumentException |
||
73 | * @expectedExceptionMessage Service locator not implement Zend\ServiceManager\ServiceLocatorInterface |
||
74 | * |
||
75 | * @throws \PHPUnit_Framework_Exception |
||
76 | * @throws \Nnx\Container\Exception\InvalidArgumentException |
||
77 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
78 | */ |
||
79 | public function testInvalidServiceManager() |
||
93 | |||
94 | |||
95 | |||
96 | /** |
||
97 | * Проверка ситуации когда не удается получить ServiceListener |
||
98 | * |
||
99 | * @expectedException \Nnx\Container\Exception\InvalidArgumentException |
||
100 | * @expectedExceptionMessage ServiceListener not implement Zend\ModuleManager\Listener\ServiceListenerInterface |
||
101 | * |
||
102 | * @throws \PHPUnit_Framework_Exception |
||
103 | * @throws \Nnx\Container\Exception\InvalidArgumentException |
||
104 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
105 | */ |
||
106 | public function testInvalidServiceListener() |
||
125 | } |
||
126 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: