Completed
Push — master ( 06a6c1...f03436 )
by Aimeos
03:56
created
admin/jqadm/tests/Admin/JQAdm/Type/Plugin/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Plugin\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\Plugin\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
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'plugin/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'plugin/type');
78 78
 
79
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'order', [], 'plugin' )->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('order', [], 'plugin')->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( 'order', $result );
85
+		$this->assertContains('order', $result);
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testCopyException()
90 90
 	{
91
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
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\Plugin\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'plugin/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'plugin/type');
162 162
 
163
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'order', [], 'plugin' )->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('order', [], 'plugin')->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( 'order', $result );
169
+		$this->assertContains('order', $result);
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetException()
174 174
 	{
175
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Plugin\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Plugin\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'plugin/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'plugin/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
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', [], 'plugin' )->getId() );
234
+		$manager->deleteItem($manager->findItem('jqadm@test', [], 'plugin')->getId());
235 235
 	}
236 236
 
237 237
 
238 238
 	public function testSaveException()
239 239
 	{
240
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'plugin.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'order' ),
291
+				'key' => array(0 => 'plugin.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'order'),
294 294
 			),
295
-			'sort' => array( '-plugin.type.id' ),
295
+			'sort' => array('-plugin.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( '>order<', $result );
302
+		$this->assertContains('>order<', $result);
303 303
 	}
304 304
 
305 305
 
306 306
 	public function testSearchException()
307 307
 	{
308
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Plugin\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Plugin\Standard')
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
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'plugin/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'plugin/type');
360 360
 
361
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'order', [], 'plugin' )->getId()];
362
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
363
-		$view->addHelper( 'param', $helper );
361
+		$param = ['type' => 'unittest', 'id' => $manager->findItem('order', [], 'plugin')->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
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Type/Product/Lists/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Product\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\Product\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
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/lists/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/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\Product\Lists\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
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\Product\Lists\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/lists/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/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\Product\Lists\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Product\Lists\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Product\Lists\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/lists/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/lists/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
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\Product\Lists\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'product.lists.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'default' ),
291
+				'key' => array(0 => 'product.lists.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'default'),
294 294
 			),
295
-			'sort' => array( '-product.lists.type.id' ),
295
+			'sort' => array('-product.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\Product\Lists\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Lists\Standard')
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
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/lists/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/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
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Type/Product/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Product\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\Product\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
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/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\Product\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
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\Product\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/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\Product\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Product\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Product\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
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\Product\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'product.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'default' ),
291
+				'key' => array(0 => 'product.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'default'),
294 294
 			),
295
-			'sort' => array( '-product.type.id' ),
295
+			'sort' => array('-product.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\Product\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Standard')
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
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/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
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Type/Product/Property/StandardTest.php 1 patch
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Type\Product\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\Product\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
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
46
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
47
-			->setMethods( array( 'getSubClients' ) )
45
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
58 58
 
59 59
 	public function testCreateMShopException()
60 60
 	{
61
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
62
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
63
-			->setMethods( array( 'getSubClients' ) )
61
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
74 74
 
75 75
 	public function testCopy()
76 76
 	{
77
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property/type' );
77
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property/type');
78 78
 
79
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'package-height', [], '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('package-height', [], '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( 'package-height', $result );
85
+		$this->assertContains('package-height', $result);
86 86
 	}
87 87
 
88 88
 
89 89
 	public function testCopyException()
90 90
 	{
91
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'getSubClients' ) )
91
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
104 104
 
105 105
 	public function testCopyMShopException()
106 106
 	{
107
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
108
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
109
-			->setMethods( array( 'getSubClients' ) )
107
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
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\Product\Property\Standard' )
130
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
131
-			->setMethods( array( 'getSubClients', 'search' ) )
129
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
142 142
 
143 143
 	public function testDeleteMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'getSubClients', 'search' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
158 158
 
159 159
 	public function testGet()
160 160
 	{
161
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property/type' );
161
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property/type');
162 162
 
163
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'package-height', [], '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('package-height', [], '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( 'package-height', $result );
169
+		$this->assertContains('package-height', $result);
170 170
 	}
171 171
 
172 172
 
173 173
 	public function testGetException()
174 174
 	{
175
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
176
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
177
-			->setMethods( array( 'getSubClients' ) )
175
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
188 188
 
189 189
 	public function testGetMShopException()
190 190
 	{
191
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
192
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
193
-			->setMethods( array( 'getSubClients' ) )
191
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
204 204
 
205 205
 	public function testGetViewException()
206 206
 	{
207
-		$object = new \Aimeos\Admin\JQAdm\Type\Product\Property\Standard( $this->context, [] );
207
+		$object = new \Aimeos\Admin\JQAdm\Type\Product\Property\Standard($this->context, []);
208 208
 
209
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
209
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
210 210
 		$object->getView();
211 211
 	}
212 212
 
213 213
 
214 214
 	public function testSave()
215 215
 	{
216
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property/type' );
216
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property/type');
217 217
 
218 218
 		$param = array(
219 219
 			'type' => 'unittest',
@@ -226,26 +226,26 @@  discard block
 block discarded – undo
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\Product\Property\Standard' )
241
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
242
-			->setMethods( array( 'fromArray' ) )
240
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
253 253
 
254 254
 	public function testSaveMShopException()
255 255
 	{
256
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
257
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
258
-			->setMethods( array( 'fromArray' ) )
256
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
269 269
 
270 270
 	public function testSaveJQAdmException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'fromArray' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
288 288
 		$param = array(
289 289
 			'type' => 'unittest', 'lang' => 'de',
290 290
 			'filter' => array(
291
-				'key' => array( 0 => 'product.property.type.code' ),
292
-				'op' => array( 0 => '==' ),
293
-				'val' => array( 0 => 'package-height' ),
291
+				'key' => array(0 => 'product.property.type.code'),
292
+				'op' => array(0 => '=='),
293
+				'val' => array(0 => 'package-height'),
294 294
 			),
295
-			'sort' => array( '-product.property.type.id' ),
295
+			'sort' => array('-product.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( '>package-height<', $result );
302
+		$this->assertContains('>package-height<', $result);
303 303
 	}
304 304
 
305 305
 
306 306
 	public function testSearchException()
307 307
 	{
308
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( array( 'initCriteria' ) )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
321 321
 
322 322
 	public function testSearchMShopException()
323 323
 	{
324
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Type\Product\Property\Standard' )
325
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
326
-			->setMethods( array( 'initCriteria' ) )
324
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Type\Product\Property\Standard')
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
 block discarded – undo
337 337
 
338 338
 	public function testGetSubClientInvalid()
339 339
 	{
340
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
341
-		$this->object->getSubClient( '$unknown$' );
340
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' );
348
-		$this->object->getSubClient( 'unknown' );
347
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' )
355
-			->setConstructorArgs( array( [] ) )
356
-			->setMethods( array( 'render', 'config' ) )
354
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
355
+			->setConstructorArgs(array([]))
356
+			->setMethods(array('render', 'config'))
357 357
 			->getMock();
358 358
 
359
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property/type' );
359
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property/type');
360 360
 
361
-		$param = ['type' => 'unittest', 'id' => $manager->findItem( 'package-height', [], '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('package-height', [], '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
 	}
Please login to merge, or discard this patch.
admin/jqadm/templates/locale/item-standard.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,11 @@
 block discarded – undo
35 35
 			<?= $enc->html( $this->get( 'itemData/locale.id' ) ); ?> -
36 36
 			<?php if( $this->get( 'itemData/locale.currencyid' ) ) : ?>
37 37
 				<?= $enc->html( $this->get( 'itemData/locale.languageid' ) . '/' . $this->get( 'itemData/locale.currencyid' ) ); ?>
38
-			<?php else : ?>
39
-				<?= $enc->html( $this->translate( 'admin', 'New' ) ); ?>
38
+			<?php else {
39
+	: ?>
40
+				<?= $enc->html( $this->translate( 'admin', 'New' ) );
41
+}
42
+?>
40 43
 			<?php endif; ?>
41 44
 			<span class="navbar-secondary">(<?= $enc->html( $this->site()->match( $this->get( 'itemData/locale.siteid' ) ) ); ?>)</span>
42 45
 		</span>
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -5,42 +5,42 @@  discard block
 block discarded – undo
5 5
  * @copyright Aimeos (aimeos.org), 2017-2018
6 6
  */
7 7
 
8
-$selected = function( $key, $code ) {
9
-	return ( $key == $code ? 'selected="selected"' : '' );
8
+$selected = function($key, $code) {
9
+	return ($key == $code ? 'selected="selected"' : '');
10 10
 };
11 11
 
12 12
 $enc = $this->encoder();
13 13
 
14 14
 
15
-$target = $this->config( 'admin/jqadm/url/save/target' );
16
-$cntl = $this->config( 'admin/jqadm/url/save/controller', 'Jqadm' );
17
-$action = $this->config( 'admin/jqadm/url/save/action', 'save' );
18
-$config = $this->config( 'admin/jqadm/url/save/config', [] );
15
+$target = $this->config('admin/jqadm/url/save/target');
16
+$cntl = $this->config('admin/jqadm/url/save/controller', 'Jqadm');
17
+$action = $this->config('admin/jqadm/url/save/action', 'save');
18
+$config = $this->config('admin/jqadm/url/save/config', []);
19 19
 
20
-$params = $this->get( 'pageParams', [] );
20
+$params = $this->get('pageParams', []);
21 21
 
22 22
 
23 23
 ?>
24
-<?php $this->block()->start( 'jqadm_content' ); ?>
24
+<?php $this->block()->start('jqadm_content'); ?>
25 25
 
26
-<form class="item item-locale form-horizontal" method="POST" enctype="multipart/form-data" action="<?= $enc->attr( $this->url( $target, $cntl, $action, $params, [], $config ) ); ?>">
27
-	<input id="item-id" type="hidden" name="<?= $enc->attr( $this->formparam( array( 'item', 'locale.id' ) ) ); ?>" value="<?= $enc->attr( $this->get( 'itemData/locale.id' ) ); ?>" />
28
-	<input id="item-next" type="hidden" name="<?= $enc->attr( $this->formparam( array( 'next' ) ) ); ?>" value="get" />
26
+<form class="item item-locale form-horizontal" method="POST" enctype="multipart/form-data" action="<?= $enc->attr($this->url($target, $cntl, $action, $params, [], $config)); ?>">
27
+	<input id="item-id" type="hidden" name="<?= $enc->attr($this->formparam(array('item', 'locale.id'))); ?>" value="<?= $enc->attr($this->get('itemData/locale.id')); ?>" />
28
+	<input id="item-next" type="hidden" name="<?= $enc->attr($this->formparam(array('next'))); ?>" value="get" />
29 29
 	<?= $this->csrf()->formfield(); ?>
30 30
 
31 31
 	<nav class="main-navbar">
32 32
 		<span class="navbar-brand">
33
-			<?= $enc->html( $this->translate( 'admin', 'Locale' ) ); ?>:
34
-			<?= $enc->html( $this->get( 'itemData/locale.id' ) ); ?> -
35
-			<?php if( $this->get( 'itemData/locale.currencyid' ) ) : ?>
36
-				<?= $enc->html( $this->get( 'itemData/locale.languageid' ) . '/' . $this->get( 'itemData/locale.currencyid' ) ); ?>
33
+			<?= $enc->html($this->translate('admin', 'Locale')); ?>:
34
+			<?= $enc->html($this->get('itemData/locale.id')); ?> -
35
+			<?php if ($this->get('itemData/locale.currencyid')) : ?>
36
+				<?= $enc->html($this->get('itemData/locale.languageid') . '/' . $this->get('itemData/locale.currencyid')); ?>
37 37
 			<?php else : ?>
38
-				<?= $enc->html( $this->translate( 'admin', 'New' ) ); ?>
38
+				<?= $enc->html($this->translate('admin', 'New')); ?>
39 39
 			<?php endif; ?>
40
-			<span class="navbar-secondary">(<?= $enc->html( $this->site()->match( $this->get( 'itemData/locale.siteid' ) ) ); ?>)</span>
40
+			<span class="navbar-secondary">(<?= $enc->html($this->site()->match($this->get('itemData/locale.siteid'))); ?>)</span>
41 41
 		</span>
42 42
 		<div class="item-actions">
43
-			<?= $this->partial( $this->config( 'admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php' ), ['params' => $params] ); ?>
43
+			<?= $this->partial($this->config('admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php'), ['params' => $params]); ?>
44 44
 		</div>
45 45
 	</nav>
46 46
 
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
 
52 52
 				<li class="nav-item basic">
53 53
 					<a class="nav-link active" href="#basic" data-toggle="tab" role="tab" aria-expanded="true" aria-controls="basic">
54
-						<?= $enc->html( $this->translate( 'admin', 'Basic' ) ); ?>
54
+						<?= $enc->html($this->translate('admin', 'Basic')); ?>
55 55
 					</a>
56 56
 				</li>
57 57
 
58
-				<?php foreach( array_values( $this->get( 'itemSubparts', [] ) ) as $idx => $subpart ) : ?>
59
-					<li class="nav-item <?= $enc->attr( $subpart ); ?>">
60
-						<a class="nav-link" href="#<?= $enc->attr( $subpart ); ?>" data-toggle="tab" role="tab" tabindex="<?= ++$idx+1; ?>">
61
-							<?= $enc->html( $this->translate( 'admin', $subpart ) ); ?>
58
+				<?php foreach (array_values($this->get('itemSubparts', [])) as $idx => $subpart) : ?>
59
+					<li class="nav-item <?= $enc->attr($subpart); ?>">
60
+						<a class="nav-link" href="#<?= $enc->attr($subpart); ?>" data-toggle="tab" role="tab" tabindex="<?= ++$idx + 1; ?>">
61
+							<?= $enc->html($this->translate('admin', $subpart)); ?>
62 62
 						</a>
63 63
 					</li>
64 64
 				<?php endforeach; ?>
@@ -67,114 +67,114 @@  discard block
 block discarded – undo
67 67
 
68 68
 			<div class="item-meta text-muted">
69 69
 				<small>
70
-					<?= $enc->html( $this->translate( 'admin', 'Modified' ) ); ?>:
71
-					<span class="meta-value"><?= $enc->html( $this->get( 'itemData/locale.mtime' ) ); ?></span>
70
+					<?= $enc->html($this->translate('admin', 'Modified')); ?>:
71
+					<span class="meta-value"><?= $enc->html($this->get('itemData/locale.mtime')); ?></span>
72 72
 				</small>
73 73
 				<small>
74
-					<?= $enc->html( $this->translate( 'admin', 'Created' ) ); ?>:
75
-					<span class="meta-value"><?= $enc->html( $this->get( 'itemData/locale.ctime' ) ); ?></span>
74
+					<?= $enc->html($this->translate('admin', 'Created')); ?>:
75
+					<span class="meta-value"><?= $enc->html($this->get('itemData/locale.ctime')); ?></span>
76 76
 				</small>
77 77
 				<small>
78
-					<?= $enc->html( $this->translate( 'admin', 'Editor' ) ); ?>:
79
-					<span class="meta-value"><?= $enc->html( $this->get( 'itemData/locale.editor' ) ); ?></span>
78
+					<?= $enc->html($this->translate('admin', 'Editor')); ?>:
79
+					<span class="meta-value"><?= $enc->html($this->get('itemData/locale.editor')); ?></span>
80 80
 				</small>
81 81
 			</div>
82 82
 		</div>
83 83
 
84 84
 		<div class="col-md-9 item-content tab-content">
85
-			<?php $readonly = ( $this->access( 'admin' ) === false ? $this->site()->readonly( $this->get( 'itemData/locale.siteid' ) ) : '' ); ?>
85
+			<?php $readonly = ($this->access('admin') === false ? $this->site()->readonly($this->get('itemData/locale.siteid')) : ''); ?>
86 86
 
87 87
 			<div id="basic" class="row item-basic tab-pane fade show active" role="tabpanel" aria-labelledby="basic">
88 88
 
89 89
 				<div class="col-xl-6 content-block <?= $readonly ?>">
90 90
 					<div class="form-group row mandatory">
91
-						<label class="col-sm-4 form-control-label"><?= $enc->html( $this->translate( 'admin', 'Status' ) ); ?></label>
91
+						<label class="col-sm-4 form-control-label"><?= $enc->html($this->translate('admin', 'Status')); ?></label>
92 92
 						<div class="col-sm-8">
93 93
 							<select class="form-control custom-select item-status" required="required" tabindex="1"
94
-								name="<?= $enc->attr( $this->formparam( array( 'item', 'locale.status' ) ) ); ?>"
95
-								<?= $this->site()->readonly( $this->get( 'itemData/locale.siteid' ) ); ?> >
94
+								name="<?= $enc->attr($this->formparam(array('item', 'locale.status'))); ?>"
95
+								<?= $this->site()->readonly($this->get('itemData/locale.siteid')); ?> >
96 96
 								<option value="">
97
-									<?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?>
97
+									<?= $enc->attr($this->translate('admin', 'Please select')); ?>
98 98
 								</option>
99
-								<option value="1" <?= $selected( $this->get( 'itemData/locale.status', 1 ), 1 ); ?> >
100
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:1' ) ); ?>
99
+								<option value="1" <?= $selected($this->get('itemData/locale.status', 1), 1); ?> >
100
+									<?= $enc->html($this->translate('mshop/code', 'status:1')); ?>
101 101
 								</option>
102
-								<option value="0" <?= $selected( $this->get( 'itemData/locale.status', 1 ), 0 ); ?> >
103
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:0' ) ); ?>
102
+								<option value="0" <?= $selected($this->get('itemData/locale.status', 1), 0); ?> >
103
+									<?= $enc->html($this->translate('mshop/code', 'status:0')); ?>
104 104
 								</option>
105
-								<option value="-1" <?= $selected( $this->get( 'itemData/locale.status', 1 ), -1 ); ?> >
106
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:-1' ) ); ?>
105
+								<option value="-1" <?= $selected($this->get('itemData/locale.status', 1), -1); ?> >
106
+									<?= $enc->html($this->translate('mshop/code', 'status:-1')); ?>
107 107
 								</option>
108
-								<option value="-2" <?= $selected( $this->get( 'itemData/locale.status', 1 ), -2 ); ?> >
109
-									<?= $enc->html( $this->translate( 'mshop/code', 'status:-2' ) ); ?>
108
+								<option value="-2" <?= $selected($this->get('itemData/locale.status', 1), -2); ?> >
109
+									<?= $enc->html($this->translate('mshop/code', 'status:-2')); ?>
110 110
 								</option>
111 111
 							</select>
112 112
 						</div>
113 113
 					</div>
114 114
 					<div class="form-group row mandatory">
115
-						<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Language' ) ); ?></label>
115
+						<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Language')); ?></label>
116 116
 						<div class="col-sm-8">
117 117
 							<select class="form-control custom-select item-languageid" required="required" tabindex="1"
118
-								name="<?= $enc->attr( $this->formparam( array( 'item', 'locale.languageid' ) ) ); ?>"
119
-								<?= $this->site()->readonly( $this->get( 'itemData/locale.siteid' ) ); ?> >
118
+								name="<?= $enc->attr($this->formparam(array('item', 'locale.languageid'))); ?>"
119
+								<?= $this->site()->readonly($this->get('itemData/locale.siteid')); ?> >
120 120
 								<option value="">
121
-									<?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?>
121
+									<?= $enc->attr($this->translate('admin', 'Please select')); ?>
122 122
 								</option>
123 123
 
124
-								<?php foreach( $this->get( 'itemLanguages', [] ) as $id => $item ) : ?>
125
-									<option value="<?= $enc->attr( $id ); ?>" <?= $selected( $this->get( 'itemData/locale.languageid' ), $id ); ?> >
126
-										<?= $enc->html( $id ); ?>
124
+								<?php foreach ($this->get('itemLanguages', []) as $id => $item) : ?>
125
+									<option value="<?= $enc->attr($id); ?>" <?= $selected($this->get('itemData/locale.languageid'), $id); ?> >
126
+										<?= $enc->html($id); ?>
127 127
 									</option>
128 128
 								<?php endforeach; ?>
129 129
 							</select>
130 130
 						</div>
131 131
 						<div class="col-sm-12 form-text text-muted help-text">
132
-							<?= $enc->html( $this->translate( 'admin', 'Available language for the current site' ) ); ?>
132
+							<?= $enc->html($this->translate('admin', 'Available language for the current site')); ?>
133 133
 						</div>
134 134
 					</div>
135 135
 					<div class="form-group row mandatory">
136
-						<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Currency' ) ); ?></label>
136
+						<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Currency')); ?></label>
137 137
 						<div class="col-sm-8">
138 138
 							<select class="form-control custom-select item-currencyid" required="required" tabindex="1"
139
-								name="<?= $enc->attr( $this->formparam( array( 'item', 'locale.currencyid' ) ) ); ?>"
140
-								<?= $this->site()->readonly( $this->get( 'itemData/locale.siteid' ) ); ?> >
139
+								name="<?= $enc->attr($this->formparam(array('item', 'locale.currencyid'))); ?>"
140
+								<?= $this->site()->readonly($this->get('itemData/locale.siteid')); ?> >
141 141
 								<option value="">
142
-									<?= $enc->attr( $this->translate( 'admin', 'Please select' ) ); ?>
142
+									<?= $enc->attr($this->translate('admin', 'Please select')); ?>
143 143
 								</option>
144 144
 
145
-								<?php foreach( $this->get( 'itemCurrencies', [] ) as $id => $item ) : ?>
146
-									<option value="<?= $enc->attr( $id ); ?>" <?= $selected( $this->get( 'itemData/locale.currencyid' ), $id ); ?> >
147
-										<?= $enc->html( $id ); ?>
145
+								<?php foreach ($this->get('itemCurrencies', []) as $id => $item) : ?>
146
+									<option value="<?= $enc->attr($id); ?>" <?= $selected($this->get('itemData/locale.currencyid'), $id); ?> >
147
+										<?= $enc->html($id); ?>
148 148
 									</option>
149 149
 								<?php endforeach; ?>
150 150
 							</select>
151 151
 						</div>
152 152
 						<div class="col-sm-12 form-text text-muted help-text">
153
-							<?= $enc->html( $this->translate( 'admin', 'Available currency for the current site' ) ); ?>
153
+							<?= $enc->html($this->translate('admin', 'Available currency for the current site')); ?>
154 154
 						</div>
155 155
 					</div>
156 156
 					<div class="form-group row mandatory">
157
-						<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Position' ) ); ?></label>
157
+						<label class="col-sm-4 form-control-label help"><?= $enc->html($this->translate('admin', 'Position')); ?></label>
158 158
 						<div class="col-sm-8">
159 159
 							<input class="form-control item-position" required="required" tabindex="1" autocomplete="off"
160
-								name="<?= $enc->attr( $this->formparam( array( 'item', 'locale.position' ) ) ); ?>"
161
-								placeholder="<?= $enc->attr( $this->translate( 'admin', 'Position (required)' ) ); ?>"
162
-								value="<?= $enc->attr( $this->get( 'itemData/locale.position' ) ); ?>"
163
-								<?= $this->site()->readonly( $this->get( 'itemData/locale.siteid' ) ); ?> />
160
+								name="<?= $enc->attr($this->formparam(array('item', 'locale.position'))); ?>"
161
+								placeholder="<?= $enc->attr($this->translate('admin', 'Position (required)')); ?>"
162
+								value="<?= $enc->attr($this->get('itemData/locale.position')); ?>"
163
+								<?= $this->site()->readonly($this->get('itemData/locale.siteid')); ?> />
164 164
 						</div>
165 165
 						<div class="col-sm-12 form-text text-muted help-text">
166
-							<?= $enc->html( $this->translate( 'admin', 'Order of the language/currency combinations' ) ); ?>
166
+							<?= $enc->html($this->translate('admin', 'Order of the language/currency combinations')); ?>
167 167
 						</div>
168 168
 					</div>
169 169
 				</div>
170 170
 			</div>
171 171
 
172
-			<?= $this->get( 'itemBody' ); ?>
172
+			<?= $this->get('itemBody'); ?>
173 173
 
174 174
 		</div>
175 175
 
176 176
 		<div class="item-actions">
177
-			<?= $this->partial( $this->config( 'admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php' ), ['params' => $params] ); ?>
177
+			<?= $this->partial($this->config('admin/jqadm/partial/itemactions', 'common/partials/itemactions-standard.php'), ['params' => $params]); ?>
178 178
 		</div>
179 179
 	</div>
180 180
 </form>
@@ -182,4 +182,4 @@  discard block
 block discarded – undo
182 182
 <?php $this->block()->stop(); ?>
183 183
 
184 184
 
185
-<?= $this->render( $this->config( 'admin/jqadm/template/page', 'common/page-standard.php' ) ); ?>
185
+<?= $this->render($this->config('admin/jqadm/template/page', 'common/page-standard.php')); ?>
Please login to merge, or discard this patch.
admin/jqadm/templates/dashboard/item-order-salesday-standard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 			<div class="btn btn-card-header act-show fa"></div>
18 18
 		</div>
19 19
 		<span class="item-label header-label">
20
-			<?= $enc->html( $this->translate( 'admin', 'Sales of the last 30 days' ) ); ?>
20
+			<?= $enc->html($this->translate('admin', 'Sales of the last 30 days')); ?>
21 21
 		</span>
22 22
 	</div>
23 23
 	<div id="order-salesday-data" class="card-block collapse show content loading" role="tabpanel"
Please login to merge, or discard this patch.
admin/jqadm/templates/dashboard/item-order-countpaystatus-standard.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
 
8 8
 $enc = $this->encoder();
9 9
 $trans = array(
10
-	'-1' => $this->translate( 'mshop/code', 'pay:-1' ),
11
-	'0' => $this->translate( 'mshop/code', 'pay:0' ),
12
-	'1' => $this->translate( 'mshop/code', 'pay:1' ),
13
-	'2' => $this->translate( 'mshop/code', 'pay:2' ),
14
-	'3' => $this->translate( 'mshop/code', 'pay:3' ),
15
-	'4' => $this->translate( 'mshop/code', 'pay:4' ),
16
-	'5' => $this->translate( 'mshop/code', 'pay:5' ),
17
-	'6' => $this->translate( 'mshop/code', 'pay:6' ),
10
+	'-1' => $this->translate('mshop/code', 'pay:-1'),
11
+	'0' => $this->translate('mshop/code', 'pay:0'),
12
+	'1' => $this->translate('mshop/code', 'pay:1'),
13
+	'2' => $this->translate('mshop/code', 'pay:2'),
14
+	'3' => $this->translate('mshop/code', 'pay:3'),
15
+	'4' => $this->translate('mshop/code', 'pay:4'),
16
+	'5' => $this->translate('mshop/code', 'pay:5'),
17
+	'6' => $this->translate('mshop/code', 'pay:6'),
18 18
 );
19 19
 
20 20
 ?>
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 			<div class="btn btn-card-header act-show fa"></div>
27 27
 		</div>
28 28
 		<span class="item-label header-label">
29
-			<?= $enc->html( $this->translate( 'admin', 'Orders by payment status' ) ); ?>
29
+			<?= $enc->html($this->translate('admin', 'Orders by payment status')); ?>
30 30
 		</span>
31 31
 	</div>
32 32
 	<div id="order-countpaystatus-data" class="card-block collapse show content loading" role="tabpanel"
33
-		aria-labelledby="order-countpaystatus-head" data-translation="<?= $enc->attr( json_encode( $trans ) ); ?>">
33
+		aria-labelledby="order-countpaystatus-head" data-translation="<?= $enc->attr(json_encode($trans)); ?>">
34 34
 	</div>
35 35
 </div>
36
-<?= $this->get( 'orderpaymentstatusBody' ); ?>
36
+<?= $this->get('orderpaymentstatusBody'); ?>
Please login to merge, or discard this patch.
admin/jqadm/templates/dashboard/item-order-servicedelivery-standard.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@
 block discarded – undo
17 17
 			<div class="btn btn-card-header act-show fa"></div>
18 18
 		</div>
19 19
 		<span class="item-label header-label">
20
-			<?= $enc->html( $this->translate( 'admin', 'Delivery types' ) ); ?>
20
+			<?= $enc->html($this->translate('admin', 'Delivery types')); ?>
21 21
 		</span>
22 22
 	</div>
23 23
 	<div id="order-servicedelivery-data" class="card-block collapse show content loading" role="tabpanel"
24 24
 		aria-labelledby="order-servicedelivery-head">
25 25
 	</div>
26 26
 </div>
27
-<?= $this->get( 'orderdeliverytypeBody' ); ?>
27
+<?= $this->get('orderdeliverytypeBody'); ?>
Please login to merge, or discard this patch.
admin/jqadm/templates/dashboard/item-order-salesweekday-standard.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@
 block discarded – undo
17 17
 			<div class="btn btn-card-header act-show fa"></div>
18 18
 		</div>
19 19
 		<span class="item-label header-label">
20
-			<?= $enc->html( $this->translate( 'admin', 'Sales by weekday' ) ); ?>
20
+			<?= $enc->html($this->translate('admin', 'Sales by weekday')); ?>
21 21
 		</span>
22 22
 	</div>
23 23
 	<div id="order-salesweekday-data" class="card-block collapse show content loading" role="tabpanel"
24 24
 		aria-labelledby="order-salesweekday-head">
25 25
 	</div>
26 26
 </div>
27
-<?= $this->get( 'orderweekdayBody' ); ?>
27
+<?= $this->get('orderweekdayBody'); ?>
Please login to merge, or discard this patch.