1 | <?php |
||
21 | class ModuleTest extends AbstractHttpControllerTestCase |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Установка окружения |
||
26 | * |
||
27 | * @throws \Zend\Stdlib\Exception\LogicException |
||
28 | */ |
||
29 | public function setUp() |
||
38 | |||
39 | /** |
||
40 | * Проверка что модуль загружается |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | public function testLoadModule() |
||
48 | |||
49 | /** |
||
50 | * Проверка ситуации когда в модуль придет некорректный ModuleManager |
||
51 | * |
||
52 | * @expectedException \Nnx\EntryNameResolver\Exception\InvalidArgumentException |
||
53 | * @expectedExceptionMessage Module manager not implement Zend\ModuleManager\ModuleManager |
||
54 | * |
||
55 | * @throws \PHPUnit_Framework_Exception |
||
56 | * @throws \Nnx\EntryNameResolver\Exception\InvalidArgumentException |
||
57 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
58 | */ |
||
59 | public function testInvalidModuleManager() |
||
67 | |||
68 | |||
69 | |||
70 | /** |
||
71 | * Проверка ситуации когда не удается получить ServiceLocator |
||
72 | * |
||
73 | * @expectedException \Nnx\EntryNameResolver\Exception\InvalidArgumentException |
||
74 | * @expectedExceptionMessage Service locator not implement Zend\ServiceManager\ServiceLocatorInterface |
||
75 | * |
||
76 | * @throws \PHPUnit_Framework_Exception |
||
77 | * @throws \Nnx\EntryNameResolver\Exception\InvalidArgumentException |
||
78 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
79 | */ |
||
80 | public function testInvalidServiceManager() |
||
94 | |||
95 | |||
96 | |||
97 | /** |
||
98 | * Проверка ситуации когда не удается получить ServiceListener |
||
99 | * |
||
100 | * @expectedException \Nnx\EntryNameResolver\Exception\InvalidArgumentException |
||
101 | * @expectedExceptionMessage ServiceListener not implement Zend\ModuleManager\Listener\ServiceListenerInterface |
||
102 | * |
||
103 | * @throws \PHPUnit_Framework_Exception |
||
104 | * @throws \Nnx\EntryNameResolver\Exception\InvalidArgumentException |
||
105 | * @throws \Zend\ServiceManager\Exception\ServiceNotFoundException |
||
106 | */ |
||
107 | public function testInvalidServiceListener() |
||
126 | } |
||
127 |
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: