@@ -84,10 +84,9 @@ discard block |
||
84 | 84 | * getAdvisorList |
85 | 85 | * |
86 | 86 | * @param null $proxyObject |
87 | - * @param null $sortedList |
|
88 | - * @param null $advisorArr |
|
87 | + * @param MockInterface $advisorList |
|
89 | 88 | * |
90 | - * @return AdvisorList |
|
89 | + * @return ProxyInvocationHandler |
|
91 | 90 | */ |
92 | 91 | protected function getHandler($proxyObject = null, $method = 'originMethod', $advisorList = null) |
93 | 92 | { |
@@ -107,11 +106,10 @@ discard block |
||
107 | 106 | /** |
108 | 107 | * getAdvisorList |
109 | 108 | * |
110 | - * @param null $proxyObject |
|
111 | 109 | * @param null $sortedList |
112 | 110 | * @param null $advisorArr |
113 | 111 | * |
114 | - * @return AdvisorList |
|
112 | + * @return MockInterface |
|
115 | 113 | */ |
116 | 114 | protected function getAdvisorList($sortedList = null, $advisorArr = null) |
117 | 115 | { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $handler = $this->getHandler(null, 'origin', $advisorList); |
37 | 37 | |
38 | 38 | $args = ['1', '2']; |
39 | - $originMethod = function ($a, $b) { |
|
39 | + $originMethod = function($a, $b) { |
|
40 | 40 | return $a.$b; |
41 | 41 | }; |
42 | 42 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $handler = $this->getHandler(null, 'origin', $advisorList); |
74 | 74 | |
75 | 75 | $args = ['1', '2']; |
76 | - $originMethod = function ($a, $b) { |
|
76 | + $originMethod = function($a, $b) { |
|
77 | 77 | return $a.$b; |
78 | 78 | }; |
79 | 79 |
@@ -103,6 +103,10 @@ |
||
103 | 103 | $instance->remove($mockMedia); |
104 | 104 | } |
105 | 105 | |
106 | + /** |
|
107 | + * @param AudioHandler $object |
|
108 | + * @param string $methodName |
|
109 | + */ |
|
106 | 110 | private function invokeMethod(&$object, $methodName, array $parameters = array()) |
107 | 111 | { |
108 | 112 | $reflection = new \ReflectionClass(get_class($object)); |
@@ -151,6 +151,10 @@ |
||
151 | 151 | ]; |
152 | 152 | } |
153 | 153 | |
154 | + /** |
|
155 | + * @param VideoHandler $object |
|
156 | + * @param string $methodName |
|
157 | + */ |
|
154 | 158 | private function invokeMethod(&$object, $methodName, array $parameters = array()) |
155 | 159 | { |
156 | 160 | $reflection = new \ReflectionClass(get_class($object)); |
@@ -93,7 +93,7 @@ |
||
93 | 93 | $instance->shouldReceive('createModel')->once()->with($mockFile)->andReturn($mockVideo); |
94 | 94 | $instance->shouldReceive('extractInformation')->once()->with($mockVideo)->andReturn([ |
95 | 95 | ['streams' => true], |
96 | - ['var1' => 'val1', 'var2' => 'val2' ], |
|
96 | + ['var1' => 'val1', 'var2' => 'val2'], |
|
97 | 97 | 30, |
98 | 98 | 123456 |
99 | 99 | ]); |
@@ -15,7 +15,6 @@ |
||
15 | 15 | namespace Xpressengine\Tests\Menu; |
16 | 16 | |
17 | 17 | use PHPUnit_Framework_TestCase; |
18 | -use Mockery as m; |
|
19 | 18 | use Xpressengine\Menu\MenuType\DirectLink; |
20 | 19 | |
21 | 20 | /** |
@@ -132,6 +132,10 @@ |
||
132 | 132 | $this->assertEquals(2, $collection->count()); |
133 | 133 | } |
134 | 134 | |
135 | + /** |
|
136 | + * @param PluginCollection $object |
|
137 | + * @param string $property |
|
138 | + */ |
|
135 | 139 | protected function getPropertyValue($object, $property) |
136 | 140 | { |
137 | 141 | $refl = new \ReflectionObject($object); |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace Xpressengine\Tests\Plugin; |
3 | 3 | |
4 | 4 | use Mockery; |
5 | -use Mockery\MockInterface; |
|
6 | 5 | use Xpressengine\Plugin\PluginCollection; |
7 | 6 | use Xpressengine\Plugin\PluginEntity; |
8 | 7 |
@@ -145,14 +145,14 @@ |
||
145 | 145 | */ |
146 | 146 | public function testGetters($entity) |
147 | 147 | { |
148 | - $this->assertEquals('title',$entity->getTitle()); |
|
149 | - $this->assertEquals(__DIR__.'/plugins/plugin_sample',$entity->getPath()); |
|
148 | + $this->assertEquals('title', $entity->getTitle()); |
|
149 | + $this->assertEquals(__DIR__.'/plugins/plugin_sample', $entity->getPath()); |
|
150 | 150 | $this->assertEquals('khongchi plugin.', $entity->getDescription()); |
151 | 151 | $this->assertCount(6, $entity->getSupport()); |
152 | 152 | $this->assertEquals('khongchi/plugin_sample', $entity->getName()); |
153 | 153 | $this->assertEquals(['xpressengine', 'board'], $entity->getKeywords()); |
154 | - $this->assertEquals('khongchi',$entity->getAuthors()[0]['name']); |
|
155 | - $this->assertEquals('LGPL-2.0',$entity->getLicense()); |
|
154 | + $this->assertEquals('khongchi', $entity->getAuthors()[0]['name']); |
|
155 | + $this->assertEquals('LGPL-2.0', $entity->getLicense()); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | private function getMetaData() |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | /** |
185 | 185 | * makeCollection |
186 | 186 | * |
187 | - * @return PluginCollection |
|
187 | + * @return Mockery\MockInterface |
|
188 | 188 | */ |
189 | 189 | private function makeCollection() |
190 | 190 | { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | } |
193 | 193 | |
194 | 194 | /** |
195 | - * @return Factory |
|
195 | + * @return Mockery\MockInterface |
|
196 | 196 | */ |
197 | 197 | private function makeViewFactory() |
198 | 198 | { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | /** |
206 | 206 | * makeRegister |
207 | 207 | * |
208 | - * @return PluginRegister |
|
208 | + * @return Mockery\MockInterface |
|
209 | 209 | */ |
210 | 210 | private function makeRegister() |
211 | 211 | { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
218 | - * @return Application |
|
218 | + * @return Mockery\MockInterface |
|
219 | 219 | */ |
220 | 220 | private function makeApp() |
221 | 221 | { |
@@ -229,6 +229,9 @@ discard block |
||
229 | 229 | return Mockery::mock('\Xpressengine\Plugin\PluginEntity'); |
230 | 230 | } |
231 | 231 | |
232 | + /** |
|
233 | + * @param PluginHandler $handler |
|
234 | + */ |
|
232 | 235 | private function setConfig($handler) |
233 | 236 | { |
234 | 237 | |
@@ -237,6 +240,9 @@ discard block |
||
237 | 240 | return $config; |
238 | 241 | } |
239 | 242 | |
243 | + /** |
|
244 | + * @param Mockery\MockInterface $plugins |
|
245 | + */ |
|
240 | 246 | private function getHandler($dir = null, $plugins = null, $factory = null, $register = null, $app = null) |
241 | 247 | { |
242 | 248 | if($dir === null) $dir = __DIR__.'/plugins'; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $handler = $this->getHandler(null, $plugins); |
123 | 123 | $config = $this->setConfig($handler); |
124 | 124 | $config->shouldReceive('getVal')->with('plugin.list', [])->once()->andReturn([ |
125 | - $pluginId => [] |
|
125 | + $pluginId => [] |
|
126 | 126 | ]); |
127 | 127 | $config->shouldReceive('setVal')->withAnyArgs()->once()->andReturnNull(); |
128 | 128 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $handler = $this->getHandler(null, $plugins); |
175 | 175 | $config = $this->setConfig($handler); |
176 | 176 | $config->shouldReceive('getVal')->with('plugin.list', [])->once()->andReturn([ |
177 | - $pluginId => [] |
|
177 | + $pluginId => [] |
|
178 | 178 | ]); |
179 | 179 | $config->shouldReceive('setVal')->withAnyArgs()->once()->andReturnNull(); |
180 | 180 |
@@ -239,11 +239,21 @@ |
||
239 | 239 | |
240 | 240 | private function getHandler($dir = null, $plugins = null, $factory = null, $register = null, $app = null) |
241 | 241 | { |
242 | - if($dir === null) $dir = __DIR__.'/plugins'; |
|
243 | - if($plugins === null) $plugins = $this->makeCollection(); |
|
244 | - if($factory === null) $factory = $this->makeViewFactory(); |
|
245 | - if($register === null) $register = $this->makeRegister(); |
|
246 | - if($app === null) $app = $this->makeApp(); |
|
242 | + if($dir === null) { |
|
243 | + $dir = __DIR__.'/plugins'; |
|
244 | + } |
|
245 | + if($plugins === null) { |
|
246 | + $plugins = $this->makeCollection(); |
|
247 | + } |
|
248 | + if($factory === null) { |
|
249 | + $factory = $this->makeViewFactory(); |
|
250 | + } |
|
251 | + if($register === null) { |
|
252 | + $register = $this->makeRegister(); |
|
253 | + } |
|
254 | + if($app === null) { |
|
255 | + $app = $this->makeApp(); |
|
256 | + } |
|
247 | 257 | return new PluginHandler($dir, $plugins, $factory, $register, $app); |
248 | 258 | } |
249 | 259 | } |
@@ -239,11 +239,11 @@ |
||
239 | 239 | |
240 | 240 | private function getHandler($dir = null, $plugins = null, $factory = null, $register = null, $app = null) |
241 | 241 | { |
242 | - if($dir === null) $dir = __DIR__.'/plugins'; |
|
243 | - if($plugins === null) $plugins = $this->makeCollection(); |
|
244 | - if($factory === null) $factory = $this->makeViewFactory(); |
|
245 | - if($register === null) $register = $this->makeRegister(); |
|
246 | - if($app === null) $app = $this->makeApp(); |
|
242 | + if ($dir === null) $dir = __DIR__.'/plugins'; |
|
243 | + if ($plugins === null) $plugins = $this->makeCollection(); |
|
244 | + if ($factory === null) $factory = $this->makeViewFactory(); |
|
245 | + if ($register === null) $register = $this->makeRegister(); |
|
246 | + if ($app === null) $app = $this->makeApp(); |
|
247 | 247 | return new PluginHandler($dir, $plugins, $factory, $register, $app); |
248 | 248 | } |
249 | 249 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | |
21 | 21 | /** |
22 | - * @return boolean |
|
22 | + * @return boolean|null |
|
23 | 23 | */ |
24 | 24 | public function install() |
25 | 25 | { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | - * @return boolean |
|
30 | + * @return boolean|null |
|
31 | 31 | */ |
32 | 32 | public function unInstall() |
33 | 33 | { |
@@ -64,7 +64,7 @@ |
||
64 | 64 | ); |
65 | 65 | |
66 | 66 | $args::get('/manage', function () { |
67 | - return 'hihihi'; |
|
67 | + return 'hihihi'; |
|
68 | 68 | }); |
69 | 69 | } |
70 | 70 |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | { |
57 | 57 | // 라우트 등록 |
58 | 58 | intercept('Plugin@addPluginRoutes', 'route_for_pluginsample', |
59 | - function ($target, &$args) { |
|
59 | + function($target, &$args) { |
|
60 | 60 | $routes = $args[0]; |
61 | 61 | $this->registerAssignedRoute($routes); |
62 | 62 | $target($args); |
63 | 63 | } |
64 | 64 | ); |
65 | 65 | |
66 | - $args::get('/manage', function () { |
|
66 | + $args::get('/manage', function() { |
|
67 | 67 | return 'hihihi'; |
68 | 68 | }); |
69 | 69 | } |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | { |
73 | 73 | |
74 | 74 | |
75 | - $routes->{$this->pluginId} = function () { |
|
75 | + $routes->{$this->pluginId} = function() { |
|
76 | 76 | |
77 | 77 | // for static action |
78 | 78 | require_once('board_manager.php'); |
79 | 79 | |
80 | - Route::get('/manage', function () { |
|
80 | + Route::get('/manage', function() { |
|
81 | 81 | $boardManager = BoardManager::getInstance(); |
82 | 82 | return $boardManager->getIndex(); |
83 | 83 | }); |
84 | - Route::get('/manage/list', function () { |
|
84 | + Route::get('/manage/list', function() { |
|
85 | 85 | $boardManager = BoardManager::getInstance(); |
86 | 86 | return $boardManager->getList(); |
87 | 87 | }); |
@@ -89,17 +89,17 @@ discard block |
||
89 | 89 | // for dynamic action(using alias) |
90 | 90 | require_once('board.php'); |
91 | 91 | |
92 | - Route::get('{bid}/list', function ($bid) { |
|
92 | + Route::get('{bid}/list', function($bid) { |
|
93 | 93 | $board = Board::getInstance(); |
94 | 94 | return $board->getList($bid); |
95 | 95 | }); |
96 | 96 | |
97 | - Route::get('{bid}/setting', function ($bid) { |
|
97 | + Route::get('{bid}/setting', function($bid) { |
|
98 | 98 | $board = Board::getInstance(); |
99 | 99 | return $board->getSetting($bid); |
100 | 100 | }); |
101 | 101 | |
102 | - Route::get('{bid}/{act?}', function ($bid, $act = null) { |
|
102 | + Route::get('{bid}/{act?}', function($bid, $act = null) { |
|
103 | 103 | |
104 | 104 | $act = $act ?: \Input::get('act', 'list'); |
105 | 105 | $board = Board::getInstance(); |
@@ -91,6 +91,7 @@ |
||
91 | 91 | /** |
92 | 92 | * getReaderMock |
93 | 93 | * |
94 | + * @param string $dir |
|
94 | 95 | * @return \Mockery\MockInterface |
95 | 96 | */ |
96 | 97 | protected function getReaderMock($dir) |