@@ -19,22 +19,22 @@ discard block |
||
19 | 19 | protected function setUp() |
20 | 20 | { |
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | - $request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock(); |
|
23 | - $helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' ); |
|
24 | - $this->view ->addHelper( 'request', $helper ); |
|
22 | + $request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock(); |
|
23 | + $helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test'); |
|
24 | + $this->view ->addHelper('request', $helper); |
|
25 | 25 | |
26 | 26 | $this->context = \TestHelperJqadm::getContext(); |
27 | 27 | |
28 | - $this->object = new \Aimeos\Admin\JQAdm\Coupon\Standard( $this->context ); |
|
29 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
30 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
31 | - $this->object->setView( $this->view ); |
|
28 | + $this->object = new \Aimeos\Admin\JQAdm\Coupon\Standard($this->context); |
|
29 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
30 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
31 | + $this->object->setView($this->view); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | protected function tearDown() |
36 | 36 | { |
37 | - unset( $this->object, $this->view, $this->context ); |
|
37 | + unset($this->object, $this->view, $this->context); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -42,16 +42,16 @@ discard block |
||
42 | 42 | { |
43 | 43 | $result = $this->object->create(); |
44 | 44 | |
45 | - $this->assertContains( 'item-coupon', $result ); |
|
45 | + $this->assertContains('item-coupon', $result); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testCreateException() |
50 | 50 | { |
51 | - $object = $this->getClientMock( 'getSubClientNames' ); |
|
51 | + $object = $this->getClientMock('getSubClientNames'); |
|
52 | 52 | |
53 | - $object->expects( $this->once() )->method( 'getSubClientNames' ) |
|
54 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
53 | + $object->expects($this->once())->method('getSubClientNames') |
|
54 | + ->will($this->throwException(new \RuntimeException())); |
|
55 | 55 | |
56 | 56 | $object->create(); |
57 | 57 | } |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | |
60 | 60 | public function testCreateMShopException() |
61 | 61 | { |
62 | - $object = $this->getClientMock( 'getSubClientNames' ); |
|
62 | + $object = $this->getClientMock('getSubClientNames'); |
|
63 | 63 | |
64 | - $object->expects( $this->once() )->method( 'getSubClientNames' ) |
|
65 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
64 | + $object->expects($this->once())->method('getSubClientNames') |
|
65 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
66 | 66 | |
67 | 67 | $object->create(); |
68 | 68 | } |
@@ -71,21 +71,21 @@ discard block |
||
71 | 71 | public function testCopy() |
72 | 72 | { |
73 | 73 | $param = ['site' => 'unittest', 'id' => $this->getCoupon()->getId()]; |
74 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
75 | - $this->view->addHelper( 'param', $helper ); |
|
74 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
75 | + $this->view->addHelper('param', $helper); |
|
76 | 76 | |
77 | 77 | $result = $this->object->copy(); |
78 | 78 | |
79 | - $this->assertContains( 'Unit test example', $result ); |
|
79 | + $this->assertContains('Unit test example', $result); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
83 | 83 | public function testCopyException() |
84 | 84 | { |
85 | - $object = $this->getClientMock( 'getSubClientNames' ); |
|
85 | + $object = $this->getClientMock('getSubClientNames'); |
|
86 | 86 | |
87 | - $object->expects( $this->once() )->method( 'getSubClientNames' ) |
|
88 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
87 | + $object->expects($this->once())->method('getSubClientNames') |
|
88 | + ->will($this->throwException(new \RuntimeException())); |
|
89 | 89 | |
90 | 90 | $object->copy(); |
91 | 91 | } |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | |
94 | 94 | public function testCopyMShopException() |
95 | 95 | { |
96 | - $object = $this->getClientMock( 'getSubClientNames' ); |
|
96 | + $object = $this->getClientMock('getSubClientNames'); |
|
97 | 97 | |
98 | - $object->expects( $this->once() )->method( 'getSubClientNames' ) |
|
99 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
98 | + $object->expects($this->once())->method('getSubClientNames') |
|
99 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testDelete() |
106 | 106 | { |
107 | - $this->assertNotNull( $this->object->delete() ); |
|
107 | + $this->assertNotNull($this->object->delete()); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
111 | 111 | public function testDeleteException() |
112 | 112 | { |
113 | - $object = $this->getClientMock( 'getSubClients' ); |
|
113 | + $object = $this->getClientMock('getSubClients'); |
|
114 | 114 | |
115 | - $object->expects( $this->exactly( 2 ) )->method( 'getSubClients' ) |
|
116 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
115 | + $object->expects($this->exactly(2))->method('getSubClients') |
|
116 | + ->will($this->throwException(new \RuntimeException())); |
|
117 | 117 | |
118 | 118 | $object->delete(); |
119 | 119 | } |
@@ -121,10 +121,10 @@ discard block |
||
121 | 121 | |
122 | 122 | public function testDeleteMShopException() |
123 | 123 | { |
124 | - $object = $this->getClientMock( 'getSubClients' ); |
|
124 | + $object = $this->getClientMock('getSubClients'); |
|
125 | 125 | |
126 | - $object->expects( $this->exactly( 2 ) )->method( 'getSubClients' ) |
|
127 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
126 | + $object->expects($this->exactly(2))->method('getSubClients') |
|
127 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
128 | 128 | |
129 | 129 | $object->delete(); |
130 | 130 | } |
@@ -133,21 +133,21 @@ discard block |
||
133 | 133 | public function testGet() |
134 | 134 | { |
135 | 135 | $param = ['site' => 'unittest', 'id' => $this->getCoupon()->getId()]; |
136 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
137 | - $this->view->addHelper( 'param', $helper ); |
|
136 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
137 | + $this->view->addHelper('param', $helper); |
|
138 | 138 | |
139 | 139 | $result = $this->object->get(); |
140 | 140 | |
141 | - $this->assertContains( 'Unit test example', $result ); |
|
141 | + $this->assertContains('Unit test example', $result); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
145 | 145 | public function testGetException() |
146 | 146 | { |
147 | - $object = $this->getClientMock( 'getSubClientNames' ); |
|
147 | + $object = $this->getClientMock('getSubClientNames'); |
|
148 | 148 | |
149 | - $object->expects( $this->once() )->method( 'getSubClientNames' ) |
|
150 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
149 | + $object->expects($this->once())->method('getSubClientNames') |
|
150 | + ->will($this->throwException(new \RuntimeException())); |
|
151 | 151 | |
152 | 152 | $object->get(); |
153 | 153 | } |
@@ -155,10 +155,10 @@ discard block |
||
155 | 155 | |
156 | 156 | public function testGetMShopException() |
157 | 157 | { |
158 | - $object = $this->getClientMock( 'getSubClientNames' ); |
|
158 | + $object = $this->getClientMock('getSubClientNames'); |
|
159 | 159 | |
160 | - $object->expects( $this->once() )->method( 'getSubClientNames' ) |
|
161 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
160 | + $object->expects($this->once())->method('getSubClientNames') |
|
161 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
162 | 162 | |
163 | 163 | $object->get(); |
164 | 164 | } |
@@ -166,16 +166,16 @@ discard block |
||
166 | 166 | |
167 | 167 | public function testGetViewException() |
168 | 168 | { |
169 | - $object = new \Aimeos\Admin\JQAdm\Coupon\Standard( $this->context, [] ); |
|
169 | + $object = new \Aimeos\Admin\JQAdm\Coupon\Standard($this->context, []); |
|
170 | 170 | |
171 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
171 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
172 | 172 | $object->getView(); |
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | 176 | public function testSave() |
177 | 177 | { |
178 | - $manager = \Aimeos\MShop::create( $this->context, 'coupon' ); |
|
178 | + $manager = \Aimeos\MShop::create($this->context, 'coupon'); |
|
179 | 179 | |
180 | 180 | $param = array( |
181 | 181 | 'site' => 'unittest', |
@@ -186,27 +186,27 @@ discard block |
||
186 | 186 | 'coupon.datestart' => null, |
187 | 187 | 'coupon.dateend' => null, |
188 | 188 | 'config' => array( |
189 | - 'key' => array( 0 => 'test key' ), |
|
190 | - 'val' => array( 0 => 'test value' ), |
|
189 | + 'key' => array(0 => 'test key'), |
|
190 | + 'val' => array(0 => 'test value'), |
|
191 | 191 | ), |
192 | 192 | ), |
193 | 193 | ); |
194 | 194 | |
195 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
196 | - $this->view->addHelper( 'param', $helper ); |
|
195 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
196 | + $this->view->addHelper('param', $helper); |
|
197 | 197 | |
198 | 198 | $this->object->save(); |
199 | 199 | |
200 | - $manager->deleteItem( $this->getCoupon( 'jqadm test label' )->getId() ); |
|
200 | + $manager->deleteItem($this->getCoupon('jqadm test label')->getId()); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
204 | 204 | public function testSaveException() |
205 | 205 | { |
206 | - $object = $this->getClientMock( 'fromArray' ); |
|
206 | + $object = $this->getClientMock('fromArray'); |
|
207 | 207 | |
208 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
209 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
208 | + $object->expects($this->once())->method('fromArray') |
|
209 | + ->will($this->throwException(new \RuntimeException())); |
|
210 | 210 | |
211 | 211 | $object->save(); |
212 | 212 | } |
@@ -214,10 +214,10 @@ discard block |
||
214 | 214 | |
215 | 215 | public function testSaveMShopException() |
216 | 216 | { |
217 | - $object = $this->getClientMock( 'fromArray' ); |
|
217 | + $object = $this->getClientMock('fromArray'); |
|
218 | 218 | |
219 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
220 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
219 | + $object->expects($this->once())->method('fromArray') |
|
220 | + ->will($this->throwException(new \RuntimeException())); |
|
221 | 221 | |
222 | 222 | $object->save(); |
223 | 223 | } |
@@ -225,10 +225,10 @@ discard block |
||
225 | 225 | |
226 | 226 | public function testSaveJQAdmException() |
227 | 227 | { |
228 | - $object = $this->getClientMock( 'fromArray' ); |
|
228 | + $object = $this->getClientMock('fromArray'); |
|
229 | 229 | |
230 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
231 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
230 | + $object->expects($this->once())->method('fromArray') |
|
231 | + ->will($this->throwException(new \RuntimeException())); |
|
232 | 232 | |
233 | 233 | $object->save(); |
234 | 234 | } |
@@ -239,27 +239,27 @@ discard block |
||
239 | 239 | $param = array( |
240 | 240 | 'site' => 'unittest', 'lang' => 'de', |
241 | 241 | 'filter' => array( |
242 | - 'key' => array( 0 => 'coupon.label' ), |
|
243 | - 'op' => array( 0 => '==' ), |
|
244 | - 'val' => array( 0 => 'Unit test example' ), |
|
242 | + 'key' => array(0 => 'coupon.label'), |
|
243 | + 'op' => array(0 => '=='), |
|
244 | + 'val' => array(0 => 'Unit test example'), |
|
245 | 245 | ), |
246 | - 'sort' => array( '-coupon.id' ), |
|
246 | + 'sort' => array('-coupon.id'), |
|
247 | 247 | ); |
248 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
249 | - $this->view->addHelper( 'param', $helper ); |
|
248 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
249 | + $this->view->addHelper('param', $helper); |
|
250 | 250 | |
251 | 251 | $result = $this->object->search(); |
252 | 252 | |
253 | - $this->assertContains( '>Unit test example<', $result ); |
|
253 | + $this->assertContains('>Unit test example<', $result); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | |
257 | 257 | public function testSearchException() |
258 | 258 | { |
259 | - $object = $this->getClientMock( 'initCriteria' ); |
|
259 | + $object = $this->getClientMock('initCriteria'); |
|
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('initCriteria') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | 264 | $object->search(); |
265 | 265 | } |
@@ -267,10 +267,10 @@ discard block |
||
267 | 267 | |
268 | 268 | public function testSearchMShopException() |
269 | 269 | { |
270 | - $object = $this->getClientMock( 'initCriteria' ); |
|
270 | + $object = $this->getClientMock('initCriteria'); |
|
271 | 271 | |
272 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
273 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
272 | + $object->expects($this->once())->method('initCriteria') |
|
273 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
274 | 274 | |
275 | 275 | $object->search(); |
276 | 276 | } |
@@ -278,43 +278,43 @@ discard block |
||
278 | 278 | |
279 | 279 | public function testGetSubClient() |
280 | 280 | { |
281 | - $result = $this->object->getSubClient( 'code' ); |
|
282 | - $this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result ); |
|
281 | + $result = $this->object->getSubClient('code'); |
|
282 | + $this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | |
286 | 286 | public function testGetSubClientInvalid() |
287 | 287 | { |
288 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
289 | - $this->object->getSubClient( '$unknown$' ); |
|
288 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
289 | + $this->object->getSubClient('$unknown$'); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | |
293 | 293 | public function testGetSubClientUnknown() |
294 | 294 | { |
295 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
296 | - $this->object->getSubClient( 'unknown' ); |
|
295 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
296 | + $this->object->getSubClient('unknown'); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | |
300 | 300 | public function testGetSubClientDecoratorInvalid() |
301 | 301 | { |
302 | - $this->context->getConfig()->set( 'admin/jqadm/coupon/code/decorators/global', array( 'Invalid' ) ); |
|
302 | + $this->context->getConfig()->set('admin/jqadm/coupon/code/decorators/global', array('Invalid')); |
|
303 | 303 | |
304 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
305 | - $this->object->getSubClient( 'code' ); |
|
304 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
305 | + $this->object->getSubClient('code'); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | |
309 | - public function getClientMock( $method ) |
|
309 | + public function getClientMock($method) |
|
310 | 310 | { |
311 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Standard::class ) |
|
312 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
313 | - ->setMethods( [$method] ) |
|
311 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Standard::class) |
|
312 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
313 | + ->setMethods([$method]) |
|
314 | 314 | ->getMock(); |
315 | 315 | |
316 | - $object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
317 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
317 | + $object->setView($this->getViewNoRender()); |
|
318 | 318 | |
319 | 319 | return $object; |
320 | 320 | } |
@@ -322,32 +322,32 @@ discard block |
||
322 | 322 | |
323 | 323 | protected function getViewNoRender() |
324 | 324 | { |
325 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
326 | - ->setConstructorArgs( array( [] ) ) |
|
327 | - ->setMethods( array( 'render', 'config' ) ) |
|
325 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
326 | + ->setConstructorArgs(array([])) |
|
327 | + ->setMethods(array('render', 'config')) |
|
328 | 328 | ->getMock(); |
329 | 329 | |
330 | 330 | $param = ['site' => 'unittest', 'id' => $this->getCoupon()->getId()]; |
331 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
332 | - $view->addHelper( 'param', $helper ); |
|
331 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
332 | + $view->addHelper('param', $helper); |
|
333 | 333 | |
334 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
335 | - $view->addHelper( 'access', $helper ); |
|
334 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
335 | + $view->addHelper('access', $helper); |
|
336 | 336 | |
337 | 337 | return $view; |
338 | 338 | } |
339 | 339 | |
340 | 340 | |
341 | - protected function getCoupon( $label = 'Unit test example' ) |
|
341 | + protected function getCoupon($label = 'Unit test example') |
|
342 | 342 | { |
343 | - $manager = \Aimeos\MShop::create( $this->context, 'coupon' ); |
|
343 | + $manager = \Aimeos\MShop::create($this->context, 'coupon'); |
|
344 | 344 | |
345 | 345 | $search = $manager->createSearch(); |
346 | - $search->setConditions( $search->compare( '==', 'coupon.label', $label ) ); |
|
347 | - $items = $manager->searchItems( $search ); |
|
346 | + $search->setConditions($search->compare('==', 'coupon.label', $label)); |
|
347 | + $items = $manager->searchItems($search); |
|
348 | 348 | |
349 | - if( ( $item = reset( $items ) ) === false ) { |
|
350 | - throw new \RuntimeException( sprintf( 'No coupon for label "%1$s" found', $label ) ); |
|
349 | + if (($item = reset($items)) === false) { |
|
350 | + throw new \RuntimeException(sprintf('No coupon for label "%1$s" found', $label)); |
|
351 | 351 | } |
352 | 352 | |
353 | 353 | return $item; |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Coupon\Code\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Coupon\Code\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | $result = $this->object->copy(); |
42 | 42 | |
43 | - $this->assertContains( 'item-code', $result ); |
|
43 | + $this->assertContains('item-code', $result); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $result = $this->object->create(); |
50 | 50 | |
51 | - $this->assertContains( 'item-code', $result ); |
|
51 | + $this->assertContains('item-code', $result); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -58,22 +58,22 @@ discard block |
||
58 | 58 | |
59 | 59 | $result = $this->object->get(); |
60 | 60 | |
61 | - $this->assertContains( 'item-code', $result ); |
|
62 | - $this->assertContains( 'OPQR', $result ); |
|
61 | + $this->assertContains('item-code', $result); |
|
62 | + $this->assertContains('OPQR', $result); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | 66 | public function testGetException() |
67 | 67 | { |
68 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Code\Standard::class ) |
|
69 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
70 | - ->setMethods( array( 'toArray' ) ) |
|
68 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Code\Standard::class) |
|
69 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
70 | + ->setMethods(array('toArray')) |
|
71 | 71 | ->getMock(); |
72 | 72 | |
73 | - $object->expects( $this->once() )->method( 'toArray' ) |
|
74 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
73 | + $object->expects($this->once())->method('toArray') |
|
74 | + ->will($this->throwException(new \RuntimeException())); |
|
75 | 75 | |
76 | - $object->setView( $this->getViewNoRender() ); |
|
76 | + $object->setView($this->getViewNoRender()); |
|
77 | 77 | |
78 | 78 | $object->get(); |
79 | 79 | } |
@@ -81,15 +81,15 @@ discard block |
||
81 | 81 | |
82 | 82 | public function testGetMShopException() |
83 | 83 | { |
84 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Code\Standard::class ) |
|
85 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
86 | - ->setMethods( array( 'toArray' ) ) |
|
84 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Code\Standard::class) |
|
85 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
86 | + ->setMethods(array('toArray')) |
|
87 | 87 | ->getMock(); |
88 | 88 | |
89 | - $object->expects( $this->once() )->method( 'toArray' ) |
|
90 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
89 | + $object->expects($this->once())->method('toArray') |
|
90 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
91 | 91 | |
92 | - $object->setView( $this->getViewNoRender() ); |
|
92 | + $object->setView($this->getViewNoRender()); |
|
93 | 93 | |
94 | 94 | $object->get(); |
95 | 95 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | public function testSave() |
99 | 99 | { |
100 | - $manager = \Aimeos\MShop::create( $this->context, 'coupon/code' ); |
|
100 | + $manager = \Aimeos\MShop::create($this->context, 'coupon/code'); |
|
101 | 101 | |
102 | 102 | $param = array( |
103 | 103 | 'site' => 'unittest', |
@@ -110,28 +110,28 @@ discard block |
||
110 | 110 | ), |
111 | 111 | ); |
112 | 112 | |
113 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
114 | - $this->view->addHelper( 'param', $helper ); |
|
113 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
114 | + $this->view->addHelper('param', $helper); |
|
115 | 115 | |
116 | 116 | $this->view->item = $this->getCouponItem(); |
117 | 117 | |
118 | 118 | $this->object->save(); |
119 | 119 | |
120 | - $manager->deleteItem( $manager->findItem( 'jqadm test code' )->getId() ); |
|
120 | + $manager->deleteItem($manager->findItem('jqadm test code')->getId()); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | |
124 | 124 | public function testSaveException() |
125 | 125 | { |
126 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Standard::class ) |
|
127 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
128 | - ->setMethods( array( 'fromArray' ) ) |
|
126 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Standard::class) |
|
127 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
128 | + ->setMethods(array('fromArray')) |
|
129 | 129 | ->getMock(); |
130 | 130 | |
131 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
132 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
131 | + $object->expects($this->once())->method('fromArray') |
|
132 | + ->will($this->throwException(new \RuntimeException())); |
|
133 | 133 | |
134 | - $object->setView( $this->getViewNoRender() ); |
|
134 | + $object->setView($this->getViewNoRender()); |
|
135 | 135 | |
136 | 136 | $object->save(); |
137 | 137 | } |
@@ -139,15 +139,15 @@ discard block |
||
139 | 139 | |
140 | 140 | public function testSaveMShopException() |
141 | 141 | { |
142 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Coupon\Standard::class ) |
|
143 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
144 | - ->setMethods( array( 'fromArray' ) ) |
|
142 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Coupon\Standard::class) |
|
143 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
144 | + ->setMethods(array('fromArray')) |
|
145 | 145 | ->getMock(); |
146 | 146 | |
147 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
148 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
147 | + $object->expects($this->once())->method('fromArray') |
|
148 | + ->will($this->throwException(new \RuntimeException())); |
|
149 | 149 | |
150 | - $object->setView( $this->getViewNoRender() ); |
|
150 | + $object->setView($this->getViewNoRender()); |
|
151 | 151 | |
152 | 152 | $object->save(); |
153 | 153 | } |
@@ -155,16 +155,16 @@ discard block |
||
155 | 155 | |
156 | 156 | public function testGetSubClient() |
157 | 157 | { |
158 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
159 | - $this->object->getSubClient( 'unknown' ); |
|
158 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
159 | + $this->object->getSubClient('unknown'); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | |
163 | 163 | protected function getViewNoRender() |
164 | 164 | { |
165 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
166 | - ->setConstructorArgs( array( [] ) ) |
|
167 | - ->setMethods( array( 'render', 'config' ) ) |
|
165 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
166 | + ->setConstructorArgs(array([])) |
|
167 | + ->setMethods(array('render', 'config')) |
|
168 | 168 | ->getMock(); |
169 | 169 | |
170 | 170 | $view->item = $this->getCouponItem(); |
@@ -173,17 +173,17 @@ discard block |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | - protected function getCouponItem( $provider = 'Example,BasketValues' ) |
|
176 | + protected function getCouponItem($provider = 'Example,BasketValues') |
|
177 | 177 | { |
178 | - $manager = \Aimeos\MShop::create( $this->context, 'coupon' ); |
|
178 | + $manager = \Aimeos\MShop::create($this->context, 'coupon'); |
|
179 | 179 | |
180 | 180 | $search = $manager->createSearch(); |
181 | - $search->setConditions( $search->compare( '==', 'coupon.provider', $provider ) ); |
|
181 | + $search->setConditions($search->compare('==', 'coupon.provider', $provider)); |
|
182 | 182 | |
183 | - $items = $manager->searchItems( $search ); |
|
183 | + $items = $manager->searchItems($search); |
|
184 | 184 | |
185 | - if( ( $item = reset( $items ) ) === false ) { |
|
186 | - throw new \RuntimeException( 'No coupon item found' ); |
|
185 | + if (($item = reset($items)) === false) { |
|
186 | + throw new \RuntimeException('No coupon item found'); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return $item; |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Tag\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Tag\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'tag/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'sort', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('sort', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'sort', $result ); |
|
85 | + $this->assertContains('sort', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'tag/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'sort', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('sort', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'sort', $result ); |
|
169 | + $this->assertContains('sort', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Tag\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Tag\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'tag/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'tag.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'sort' ), |
|
291 | + 'key' => array(0 => 'tag.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'sort'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-tag.type.id' ), |
|
295 | + 'sort' => array('-tag.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>sort<', $result ); |
|
302 | + $this->assertContains('>sort<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Tag\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Tag\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'tag/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'tag/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'sort', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('sort', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'media/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'media/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Media\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Media\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'media/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'media.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'media.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-media.type.id' ), |
|
295 | + 'sort' => array('-media.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'media/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'media/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'media/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'media/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'media/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'media.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'media.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-media.lists.type.id' ), |
|
295 | + 'sort' => array('-media.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'media/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'media/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('size', [], 'media')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'size', $result ); |
|
85 | + $this->assertContains('size', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('size', [], 'media')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'size', $result ); |
|
169 | + $this->assertContains('size', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Media\Property\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'media.property.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'size' ), |
|
291 | + 'key' => array(0 => 'media.property.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'size'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-media.property.type.id' ), |
|
295 | + 'sort' => array('-media.property.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>size<', $result ); |
|
302 | + $this->assertContains('>size<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Media\Property\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'media/property/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'media/property/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'size', [], 'media' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('size', [], 'media')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'catalog.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'catalog.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-catalog.lists.type.id' ), |
|
295 | + 'sort' => array('-catalog.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Catalog\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'catalog/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'catalog/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Service\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Service\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'service/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'payment', [], 'service' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('payment', [], 'service')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'payment', $result ); |
|
85 | + $this->assertContains('payment', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'service/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'payment', [], 'service' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('payment', [], 'service')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'payment', $result ); |
|
169 | + $this->assertContains('payment', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Service\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Service\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'service/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'service' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'service')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'service.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'payment' ), |
|
291 | + 'key' => array(0 => 'service.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'payment'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-service.type.id' ), |
|
295 | + 'sort' => array('-service.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>payment<', $result ); |
|
302 | + $this->assertContains('>payment<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'service/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'service/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'payment', [], 'service' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('payment', [], 'service')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'service/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'service/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'service/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'service/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'service/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'service/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'service.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'service.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-service.lists.type.id' ), |
|
295 | + 'sort' => array('-service.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Service\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'service/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'service/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |