Completed
Push — master ( b98343...f157ac )
by Aimeos
03:37
created
admin/jqadm/tests/Admin/JQAdm/Product/StandardTest.php 1 patch
Spacing   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -17,21 +17,21 @@  discard block
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->view = \TestHelperJqadm::getView();
20
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
21
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
22
-		$this->view ->addHelper( 'request', $helper );
20
+		$request = $this->getMock('\Psr\Http\Message\ServerRequestInterface');
21
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
22
+		$this->view ->addHelper('request', $helper);
23 23
 
24 24
 		$this->context = \TestHelperJqadm::getContext();
25 25
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
26 26
 
27
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, $templatePaths );
28
-		$this->object->setView( $this->view );
27
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, $templatePaths);
28
+		$this->object->setView($this->view);
29 29
 	}
30 30
 
31 31
 
32 32
 	protected function tearDown()
33 33
 	{
34
-		unset( $this->object );
34
+		unset($this->object);
35 35
 	}
36 36
 
37 37
 
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 
44 44
 	public function testCreateException()
45 45
 	{
46
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
47
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
48
-			->setMethods( array( 'getSubClients' ) )
46
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
47
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
48
+			->setMethods(array('getSubClients'))
49 49
 			->getMock();
50 50
 
51
-		$object->expects( $this->once() )->method( 'getSubClients' )
52
-			->will( $this->throwException( new \Exception() ) );
51
+		$object->expects($this->once())->method('getSubClients')
52
+			->will($this->throwException(new \Exception()));
53 53
 
54
-		$object->setView( $this->getViewNoRender() );
54
+		$object->setView($this->getViewNoRender());
55 55
 
56 56
 		$object->create();
57 57
 	}
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 
60 60
 	public function testCreateMShopException()
61 61
 	{
62
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
63
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
64
-			->setMethods( array( 'getSubClients' ) )
62
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
63
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
64
+			->setMethods(array('getSubClients'))
65 65
 			->getMock();
66 66
 
67
-		$object->expects( $this->once() )->method( 'getSubClients' )
68
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
67
+		$object->expects($this->once())->method('getSubClients')
68
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
69 69
 
70
-		$object->setView( $this->getViewNoRender() );
70
+		$object->setView($this->getViewNoRender());
71 71
 
72 72
 		$object->create();
73 73
 	}
@@ -75,29 +75,29 @@  discard block
 block discarded – undo
75 75
 
76 76
 	public function testCopy()
77 77
 	{
78
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
78
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
79 79
 
80
-		$param = array( 'id' => $manager->findItem( 'CNC' )->getId() );
81
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
82
-		$this->view->addHelper( 'param', $helper );
80
+		$param = array('id' => $manager->findItem('CNC')->getId());
81
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
82
+		$this->view->addHelper('param', $helper);
83 83
 
84 84
 		$result = $this->object->copy();
85 85
 
86
-		$this->assertContains( 'CNC_copy', $result );
86
+		$this->assertContains('CNC_copy', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testCopyException()
91 91
 	{
92
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
93
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
94
-			->setMethods( array( 'getSubClients' ) )
92
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
93
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
94
+			->setMethods(array('getSubClients'))
95 95
 			->getMock();
96 96
 
97
-		$object->expects( $this->once() )->method( 'getSubClients' )
98
-			->will( $this->throwException( new \Exception() ) );
97
+		$object->expects($this->once())->method('getSubClients')
98
+			->will($this->throwException(new \Exception()));
99 99
 
100
-		$object->setView( $this->getViewNoRender() );
100
+		$object->setView($this->getViewNoRender());
101 101
 
102 102
 		$object->copy();
103 103
 	}
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 
106 106
 	public function testCopyMShopException()
107 107
 	{
108
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
109
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
110
-			->setMethods( array( 'getSubClients' ) )
108
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
109
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
110
+			->setMethods(array('getSubClients'))
111 111
 			->getMock();
112 112
 
113
-		$object->expects( $this->once() )->method( 'getSubClients' )
114
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
113
+		$object->expects($this->once())->method('getSubClients')
114
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
115 115
 
116
-		$object->setView( $this->getViewNoRender() );
116
+		$object->setView($this->getViewNoRender());
117 117
 
118 118
 		$object->copy();
119 119
 	}
@@ -121,21 +121,21 @@  discard block
 block discarded – undo
121 121
 
122 122
 	public function testDelete()
123 123
 	{
124
-		$this->assertNull( $this->object->delete() );
124
+		$this->assertNull($this->object->delete());
125 125
 	}
126 126
 
127 127
 
128 128
 	public function testDeleteException()
129 129
 	{
130
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
131
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
132
-			->setMethods( array( 'getSubClients' ) )
130
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
131
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
132
+			->setMethods(array('getSubClients'))
133 133
 			->getMock();
134 134
 
135
-		$object->expects( $this->once() )->method( 'getSubClients' )
136
-			->will( $this->throwException( new \Exception() ) );
135
+		$object->expects($this->once())->method('getSubClients')
136
+			->will($this->throwException(new \Exception()));
137 137
 
138
-		$object->setView( $this->getViewNoRender() );
138
+		$object->setView($this->getViewNoRender());
139 139
 
140 140
 		$object->delete();
141 141
 	}
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
 
144 144
 	public function testDeleteMShopException()
145 145
 	{
146
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
147
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
148
-			->setMethods( array( 'getSubClients' ) )
146
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
147
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
148
+			->setMethods(array('getSubClients'))
149 149
 			->getMock();
150 150
 
151
-		$object->expects( $this->once() )->method( 'getSubClients' )
152
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
151
+		$object->expects($this->once())->method('getSubClients')
152
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
153 153
 
154
-		$object->setView( $this->getViewNoRender() );
154
+		$object->setView($this->getViewNoRender());
155 155
 
156 156
 		$object->delete();
157 157
 	}
@@ -159,29 +159,29 @@  discard block
 block discarded – undo
159 159
 
160 160
 	public function testGet()
161 161
 	{
162
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
162
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
163 163
 
164
-		$param = array( 'id' => $manager->findItem( 'CNC' )->getId() );
165
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
166
-		$this->view->addHelper( 'param', $helper );
164
+		$param = array('id' => $manager->findItem('CNC')->getId());
165
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
166
+		$this->view->addHelper('param', $helper);
167 167
 
168 168
 		$result = $this->object->get();
169 169
 
170
-		$this->assertContains( 'CNC', $result );
170
+		$this->assertContains('CNC', $result);
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testGetException()
175 175
 	{
176
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
177
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
178
-			->setMethods( array( 'getSubClients' ) )
176
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
177
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
178
+			->setMethods(array('getSubClients'))
179 179
 			->getMock();
180 180
 
181
-		$object->expects( $this->once() )->method( 'getSubClients' )
182
-			->will( $this->throwException( new \Exception() ) );
181
+		$object->expects($this->once())->method('getSubClients')
182
+			->will($this->throwException(new \Exception()));
183 183
 
184
-		$object->setView( $this->getViewNoRender() );
184
+		$object->setView($this->getViewNoRender());
185 185
 
186 186
 		$object->get();
187 187
 	}
@@ -189,15 +189,15 @@  discard block
 block discarded – undo
189 189
 
190 190
 	public function testGetMShopException()
191 191
 	{
192
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
193
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
194
-			->setMethods( array( 'getSubClients' ) )
192
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
193
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
194
+			->setMethods(array('getSubClients'))
195 195
 			->getMock();
196 196
 
197
-		$object->expects( $this->once() )->method( 'getSubClients' )
198
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
197
+		$object->expects($this->once())->method('getSubClients')
198
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
199 199
 
200
-		$object->setView( $this->getViewNoRender() );
200
+		$object->setView($this->getViewNoRender());
201 201
 
202 202
 		$object->get();
203 203
 	}
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
 
206 206
 	public function testSave()
207 207
 	{
208
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
209
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' );
208
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
209
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/type');
210 210
 
211 211
 		$search = $typeManager->createSearch();
212
-		$search->setSlice( 0, 1 );
213
-		$typeItems = $typeManager->searchItems( $search );
212
+		$search->setSlice(0, 1);
213
+		$typeItems = $typeManager->searchItems($search);
214 214
 
215
-		if( ( $typeItem = reset( $typeItems ) ) === false ) {
216
-			throw new \Exception( 'No product type item found' );
215
+		if (($typeItem = reset($typeItems)) === false) {
216
+			throw new \Exception('No product type item found');
217 217
 		}
218 218
 
219 219
 
@@ -226,42 +226,42 @@  discard block
 block discarded – undo
226 226
 				'product.datestart' => null,
227 227
 				'product.dateend' => null,
228 228
 				'config' => array(
229
-					'key' => array( 0 => 'test key' ),
230
-					'val' => array( 0 => 'test value' ),
229
+					'key' => array(0 => 'test key'),
230
+					'val' => array(0 => 'test value'),
231 231
 				),
232 232
 			),
233 233
 		);
234 234
 
235
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
236
-		$this->view->addHelper( 'param', $helper );
235
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
236
+		$this->view->addHelper('param', $helper);
237 237
 
238 238
 		$this->object->save();
239 239
 
240
-		$manager->deleteItem( $manager->findItem( 'test' )->getId() );
240
+		$manager->deleteItem($manager->findItem('test')->getId());
241 241
 	}
242 242
 
243 243
 
244 244
 	public function testSaveException()
245 245
 	{
246
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
247
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
248
-			->setMethods( array( 'getSubClients' ) )
246
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
247
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
248
+			->setMethods(array('getSubClients'))
249 249
 			->getMock();
250 250
 
251 251
 		$name = 'AdminJQAdmStandard';
252
-		$this->context->getConfig()->set( 'mshop/product/manager/name', $name );
252
+		$this->context->getConfig()->set('mshop/product/manager/name', $name);
253 253
 
254
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Product\Manager\Standard' )
255
-			->setConstructorArgs( array( $this->context ) )
256
-			->setMethods( array( 'createItem' ) )
254
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Product\Manager\Standard')
255
+			->setConstructorArgs(array($this->context))
256
+			->setMethods(array('createItem'))
257 257
 			->getMock();
258 258
 
259
-		$mock->expects( $this->exactly( 2 ) )->method( 'createItem' )
260
-			->will( $this->throwException( new \Exception() ) );
259
+		$mock->expects($this->exactly(2))->method('createItem')
260
+			->will($this->throwException(new \Exception()));
261 261
 
262
-		\Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock );
262
+		\Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock);
263 263
 
264
-		$object->setView( $this->getViewNoRender() );
264
+		$object->setView($this->getViewNoRender());
265 265
 
266 266
 		$object->save();
267 267
 	}
@@ -269,25 +269,25 @@  discard block
 block discarded – undo
269 269
 
270 270
 	public function testSaveMShopException()
271 271
 	{
272
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
273
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
274
-			->setMethods( array( 'getSubClients' ) )
272
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
273
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
274
+			->setMethods(array('getSubClients'))
275 275
 			->getMock();
276 276
 
277 277
 		$name = 'AdminJQAdmStandard';
278
-		$this->context->getConfig()->set( 'mshop/product/manager/name', $name );
278
+		$this->context->getConfig()->set('mshop/product/manager/name', $name);
279 279
 
280
-		$mock = $this->getMockBuilder( '\Aimeos\MShop\Product\Manager\Standard' )
281
-			->setConstructorArgs( array( $this->context ) )
282
-			->setMethods( array( 'createItem' ) )
280
+		$mock = $this->getMockBuilder('\Aimeos\MShop\Product\Manager\Standard')
281
+			->setConstructorArgs(array($this->context))
282
+			->setMethods(array('createItem'))
283 283
 			->getMock();
284 284
 
285
-		$mock->expects( $this->exactly( 2 ) )->method( 'createItem' )
286
-			->will( $this->throwException( new \Exception() ) );
285
+		$mock->expects($this->exactly(2))->method('createItem')
286
+			->will($this->throwException(new \Exception()));
287 287
 
288
-		\Aimeos\MShop\Product\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock );
288
+		\Aimeos\MShop\Product\Manager\Factory::injectManager('\\Aimeos\\MShop\\Product\\Manager\\' . $name, $mock);
289 289
 
290
-		$object->setView( $this->getViewNoRender() );
290
+		$object->setView($this->getViewNoRender());
291 291
 
292 292
 		$object->save();
293 293
 	}
@@ -295,26 +295,26 @@  discard block
 block discarded – undo
295 295
 
296 296
 	public function testSearch()
297 297
 	{
298
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, array( 'site' => 'unittest', 'lang' => 'de' ) );
299
-		$this->view->addHelper( 'param', $helper );
298
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, array('site' => 'unittest', 'lang' => 'de'));
299
+		$this->view->addHelper('param', $helper);
300 300
 
301 301
 		$result = $this->object->search();
302 302
 
303
-		$this->assertContains( 'CNE', $result );
303
+		$this->assertContains('CNE', $result);
304 304
 	}
305 305
 
306 306
 
307 307
 	public function testSearchException()
308 308
 	{
309
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
310
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
311
-			->setMethods( array( 'getSubClients' ) )
309
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
310
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
311
+			->setMethods(array('getSubClients'))
312 312
 			->getMock();
313 313
 
314
-		$object->expects( $this->once() )->method( 'getSubClients' )
315
-			->will( $this->throwException( new \Exception() ) );
314
+		$object->expects($this->once())->method('getSubClients')
315
+			->will($this->throwException(new \Exception()));
316 316
 
317
-		$object->setView( $this->getViewNoRender() );
317
+		$object->setView($this->getViewNoRender());
318 318
 
319 319
 		$object->search();
320 320
 	}
@@ -322,15 +322,15 @@  discard block
 block discarded – undo
322 322
 
323 323
 	public function testSearchMShopException()
324 324
 	{
325
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
326
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
327
-			->setMethods( array( 'getSubClients' ) )
325
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
326
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
327
+			->setMethods(array('getSubClients'))
328 328
 			->getMock();
329 329
 
330
-		$object->expects( $this->once() )->method( 'getSubClients' )
331
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
330
+		$object->expects($this->once())->method('getSubClients')
331
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
332 332
 
333
-		$object->setView( $this->getViewNoRender() );
333
+		$object->setView($this->getViewNoRender());
334 334
 
335 335
 		$object->search();
336 336
 	}
@@ -338,16 +338,16 @@  discard block
 block discarded – undo
338 338
 
339 339
 	public function testGetSubClient()
340 340
 	{
341
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
342
-		$this->object->getSubClient( 'invalid' );
341
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
342
+		$this->object->getSubClient('invalid');
343 343
 	}
344 344
 
345 345
 
346 346
 	protected function getViewNoRender()
347 347
 	{
348
-		return $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
349
-			->setConstructorArgs( array( array() ) )
350
-			->setMethods( array( 'render', 'config' ) )
348
+		return $this->getMockBuilder('\Aimeos\MW\View\Standard')
349
+			->setConstructorArgs(array(array()))
350
+			->setMethods(array('render', 'config'))
351 351
 			->getMock();
352 352
 	}
353 353
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Image/StandardTest.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -22,39 +22,39 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Image\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Image\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Images', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Images', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'CNC', array( 'media' ) );
52
+		$this->view->item = $manager->findItem('CNC', array('media'));
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'src="/prod_123x103/195_prod_123x103.jpg"', $result );
57
-		$this->assertContains( 'src="/prod_266x221/198_prod_266x221.jpg"', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('src="/prod_123x103/195_prod_123x103.jpg"', $result);
57
+		$this->assertContains('src="/prod_266x221/198_prod_266x221.jpg"', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,138 +62,138 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNC', array( 'media' ) );
74
+		$this->view->item = $manager->findItem('CNC', array('media'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'src="/prod_123x103/195_prod_123x103.jpg"', $result );
79
-		$this->assertContains( 'src="/prod_266x221/198_prod_266x221.jpg"', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('src="/prod_123x103/195_prod_123x103.jpg"', $result);
79
+		$this->assertContains('src="/prod_266x221/198_prod_266x221.jpg"', $result);
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testSave()
84 84
 	{
85
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
85
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
86 86
 
87
-		$item = $manager->findItem( 'CNC' );
88
-		$item->setCode( 'jqadm-test-image' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('CNC');
88
+		$item->setCode('jqadm-test-image');
89
+		$item->setId(null);
90 90
 
91
-		$manager->saveItem( $item );
91
+		$manager->saveItem($item);
92 92
 
93 93
 
94 94
 		$param = array(
95 95
 			'image' => array(
96
-				'product.lists.id' => array( '' ),
97
-				'media.languageid' => array( 'de' ),
98
-				'media.label' => array( 'test' ),
96
+				'product.lists.id' => array(''),
97
+				'media.languageid' => array('de'),
98
+				'media.label' => array('test'),
99 99
 			),
100 100
 		);
101 101
 
102
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
103
-		$this->view->addHelper( 'param', $helper );
102
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
103
+		$this->view->addHelper('param', $helper);
104 104
 
105
-		$file = $this->getMock( '\Psr\Http\Message\UploadedFileInterface' );
106
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
107
-		$request->expects( $this->any() )->method( 'getUploadedFiles' )
108
-			->will( $this->returnValue( array( 'image' => array( 'files' => array( $file ) ) ) ) );
105
+		$file = $this->getMock('\Psr\Http\Message\UploadedFileInterface');
106
+		$request = $this->getMock('\Psr\Http\Message\ServerRequestInterface');
107
+		$request->expects($this->any())->method('getUploadedFiles')
108
+			->will($this->returnValue(array('image' => array('files' => array($file)))));
109 109
 
110
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
111
-		$this->view ->addHelper( 'request', $helper );
110
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
111
+		$this->view ->addHelper('request', $helper);
112 112
 
113 113
 		$this->view->item = $item;
114 114
 
115 115
 
116 116
 		$name = 'AdminJQAdmProductImageSave';
117
-		$this->context->getConfig()->set( 'controller/common/media/name', $name );
117
+		$this->context->getConfig()->set('controller/common/media/name', $name);
118 118
 
119
-		$cntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Media\\Standard' )
120
-			->setConstructorArgs( array( $this->context ) )
121
-			->setMethods( array( 'add' ) )
119
+		$cntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Media\\Standard')
120
+			->setConstructorArgs(array($this->context))
121
+			->setMethods(array('add'))
122 122
 			->getMock();
123 123
 
124
-		\Aimeos\Controller\Common\Media\Factory::injectController( '\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub );
124
+		\Aimeos\Controller\Common\Media\Factory::injectController('\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub);
125 125
 
126
-		$cntlStub->expects( $this->once() )->method( 'add' );
126
+		$cntlStub->expects($this->once())->method('add');
127 127
 
128 128
 
129
-		$mediaStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Media\\Manager\\Standard' )
130
-			->setConstructorArgs( array( $this->context ) )
131
-			->setMethods( array( 'saveItem' ) )
129
+		$mediaStub = $this->getMockBuilder('\\Aimeos\\MShop\\Media\\Manager\\Standard')
130
+			->setConstructorArgs(array($this->context))
131
+			->setMethods(array('saveItem'))
132 132
 			->getMock();
133 133
 
134
-		\Aimeos\MShop\Factory::injectManager( $this->context, 'media', $mediaStub );
134
+		\Aimeos\MShop\Factory::injectManager($this->context, 'media', $mediaStub);
135 135
 
136
-		$mediaStub->expects( $this->once() )->method( 'saveItem' );
136
+		$mediaStub->expects($this->once())->method('saveItem');
137 137
 
138 138
 
139
-		\Aimeos\MShop\Factory::setCache( true );
139
+		\Aimeos\MShop\Factory::setCache(true);
140 140
 
141 141
 		$result = $this->object->save();
142 142
 
143
-		\Aimeos\MShop\Factory::setCache( false );
143
+		\Aimeos\MShop\Factory::setCache(false);
144 144
 
145
-		$item = $manager->getItem( $item->getId(), array( 'media' ) );
146
-		$manager->deleteItem( $item->getId() );
145
+		$item = $manager->getItem($item->getId(), array('media'));
146
+		$manager->deleteItem($item->getId());
147 147
 
148
-		$this->assertNull( $this->view->get( 'errors' ) );
149
-		$this->assertNull( $result );
150
-		$this->assertEquals( 1, count( $item->getListItems( 'media' ) ) );
148
+		$this->assertNull($this->view->get('errors'));
149
+		$this->assertNull($result);
150
+		$this->assertEquals(1, count($item->getListItems('media')));
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testSaveException()
155 155
 	{
156
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Image\Standard' )
157
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
158
-			->setMethods( array( 'updateItems' ) )
156
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Image\Standard')
157
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
158
+			->setMethods(array('updateItems'))
159 159
 			->getMock();
160 160
 
161
-		$object->expects( $this->once() )->method( 'updateItems' )
162
-			->will( $this->throwException( new \Exception() ) );
161
+		$object->expects($this->once())->method('updateItems')
162
+			->will($this->throwException(new \Exception()));
163 163
 
164
-		$object->setView( \TestHelperJqadm::getView() );
164
+		$object->setView(\TestHelperJqadm::getView());
165 165
 
166
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
166
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
167 167
 		$object->save();
168 168
 	}
169 169
 
170 170
 
171 171
 	public function testSaveMShopException()
172 172
 	{
173
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Image\Standard' )
174
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
175
-			->setMethods( array( 'updateItems' ) )
173
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Image\Standard')
174
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
175
+			->setMethods(array('updateItems'))
176 176
 			->getMock();
177 177
 
178
-		$object->expects( $this->once() )->method( 'updateItems' )
179
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
178
+		$object->expects($this->once())->method('updateItems')
179
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
180 180
 
181
-		$object->setView( \TestHelperJqadm::getView() );
181
+		$object->setView(\TestHelperJqadm::getView());
182 182
 
183
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
183
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
184 184
 		$object->save();
185 185
 	}
186 186
 
187 187
 
188 188
 	public function testSearch()
189 189
 	{
190
-		$this->assertNull( $this->object->search() );
190
+		$this->assertNull($this->object->search());
191 191
 	}
192 192
 
193 193
 
194 194
 	public function testGetSubClient()
195 195
 	{
196
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
197
-		$this->object->getSubClient( 'invalid' );
196
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
197
+		$this->object->getSubClient('invalid');
198 198
 	}
199 199
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Category/StandardTest.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -22,40 +22,40 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Category\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Category\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Categories', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Categories', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'CNC' );
52
+		$this->view->item = $manager->findItem('CNC');
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'value="Internet"', $result );
57
-		$this->assertContains( 'value="Neu"', $result );
58
-		$this->assertContains( 'value="Kaffee"', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('value="Internet"', $result);
57
+		$this->assertContains('value="Neu"', $result);
58
+		$this->assertContains('value="Kaffee"', $result);
59 59
 	}
60 60
 
61 61
 
@@ -63,146 +63,146 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		$result = $this->object->delete();
65 65
 
66
-		$this->assertNull( $this->view->get( 'errors' ) );
67
-		$this->assertNull( $result );
66
+		$this->assertNull($this->view->get('errors'));
67
+		$this->assertNull($result);
68 68
 	}
69 69
 
70 70
 
71 71
 	public function testGet()
72 72
 	{
73
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
73
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
74 74
 
75
-		$this->view->item = $manager->findItem( 'CNC' );
75
+		$this->view->item = $manager->findItem('CNC');
76 76
 		$result = $this->object->get();
77 77
 
78
-		$this->assertNull( $this->view->get( 'errors' ) );
79
-		$this->assertContains( 'value="Internet"', $result );
80
-		$this->assertContains( 'value="Neu"', $result );
81
-		$this->assertContains( 'value="Kaffee"', $result );
78
+		$this->assertNull($this->view->get('errors'));
79
+		$this->assertContains('value="Internet"', $result);
80
+		$this->assertContains('value="Neu"', $result);
81
+		$this->assertContains('value="Kaffee"', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' );
88
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog/lists/type' );
89
-		$productManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
87
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog');
88
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog/lists/type');
89
+		$productManager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
90 90
 
91
-		$item = $manager->findItem( 'root' );
92
-		$item->setCode( 'jqadm-test-root' );
93
-		$item->setId( null );
91
+		$item = $manager->findItem('root');
92
+		$item->setCode('jqadm-test-root');
93
+		$item->setId(null);
94 94
 
95
-		$manager->insertItem( $item );
95
+		$manager->insertItem($item);
96 96
 
97 97
 
98
-		$typeid = $typeManager->findItem( 'default', array(), 'product' )->getId();
98
+		$typeid = $typeManager->findItem('default', array(), 'product')->getId();
99 99
 
100 100
 		$param = array(
101 101
 			'category' => array(
102
-				'catalog.lists.id' => array( '' ),
103
-				'catalog.lists.typeid' => array( $typeid ),
104
-				'catalog.id' => array( $item->getId() ),
102
+				'catalog.lists.id' => array(''),
103
+				'catalog.lists.typeid' => array($typeid),
104
+				'catalog.id' => array($item->getId()),
105 105
 			),
106 106
 		);
107 107
 
108
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
109
-		$this->view->addHelper( 'param', $helper );
108
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
109
+		$this->view->addHelper('param', $helper);
110 110
 		$this->view->item = $productManager->createItem();
111 111
 
112 112
 		$result = $this->object->save();
113 113
 
114
-		$item = $manager->getItem( $item->getId(), array( 'product' ) );
115
-		$manager->deleteItem( $item->getId() );
114
+		$item = $manager->getItem($item->getId(), array('product'));
115
+		$manager->deleteItem($item->getId());
116 116
 
117
-		$this->assertNull( $this->view->get( 'errors' ) );
118
-		$this->assertNull( $result );
119
-		$this->assertEquals( 1, count( $item->getListItems( 'product' ) ) );
117
+		$this->assertNull($this->view->get('errors'));
118
+		$this->assertNull($result);
119
+		$this->assertEquals(1, count($item->getListItems('product')));
120 120
 	}
121 121
 
122 122
 
123 123
 	public function testSavePromotion()
124 124
 	{
125
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' );
126
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog/lists/type' );
127
-		$productManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
125
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog');
126
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog/lists/type');
127
+		$productManager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
128 128
 
129
-		$item = $manager->findItem( 'root' );
130
-		$item->setCode( 'jqadm-test-root' );
131
-		$item->setId( null );
129
+		$item = $manager->findItem('root');
130
+		$item->setCode('jqadm-test-root');
131
+		$item->setId(null);
132 132
 
133
-		$manager->insertItem( $item );
133
+		$manager->insertItem($item);
134 134
 
135 135
 
136
-		$typeid = $typeManager->findItem( 'promotion', array(), 'product' )->getId();
136
+		$typeid = $typeManager->findItem('promotion', array(), 'product')->getId();
137 137
 
138 138
 		$param = array(
139 139
 			'category' => array(
140
-				'catalog.lists.id' => array( '' ),
141
-				'catalog.lists.typeid' => array( $typeid ),
142
-				'catalog.id' => array( $item->getId() ),
140
+				'catalog.lists.id' => array(''),
141
+				'catalog.lists.typeid' => array($typeid),
142
+				'catalog.id' => array($item->getId()),
143 143
 			),
144 144
 		);
145 145
 
146
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
147
-		$this->view->addHelper( 'param', $helper );
146
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
147
+		$this->view->addHelper('param', $helper);
148 148
 		$this->view->item = $productManager->createItem();
149 149
 
150 150
 		$result = $this->object->save();
151 151
 
152
-		$item = $manager->getItem( $item->getId(), array( 'product' ) );
153
-		$listItems = $item->getListItems( 'product' );
154
-		$manager->deleteItem( $item->getId() );
152
+		$item = $manager->getItem($item->getId(), array('product'));
153
+		$listItems = $item->getListItems('product');
154
+		$manager->deleteItem($item->getId());
155 155
 
156
-		$this->assertNull( $this->view->get( 'errors' ) );
157
-		$this->assertNull( $result );
158
-		$this->assertEquals( 1, count( $listItems ) );
159
-		$this->assertEquals( $typeid, reset( $listItems )->getTypeId() );
156
+		$this->assertNull($this->view->get('errors'));
157
+		$this->assertNull($result);
158
+		$this->assertEquals(1, count($listItems));
159
+		$this->assertEquals($typeid, reset($listItems)->getTypeId());
160 160
 	}
161 161
 
162 162
 
163 163
 	public function testSaveException()
164 164
 	{
165
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Category\Standard' )
166
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
167
-			->setMethods( array( 'updateItems' ) )
165
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Category\Standard')
166
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
167
+			->setMethods(array('updateItems'))
168 168
 			->getMock();
169 169
 
170
-		$object->expects( $this->once() )->method( 'updateItems' )
171
-			->will( $this->throwException( new \Exception() ) );
170
+		$object->expects($this->once())->method('updateItems')
171
+			->will($this->throwException(new \Exception()));
172 172
 
173
-		$object->setView( \TestHelperJqadm::getView() );
173
+		$object->setView(\TestHelperJqadm::getView());
174 174
 
175
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
175
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
176 176
 		$object->save();
177 177
 	}
178 178
 
179 179
 
180 180
 	public function testSaveMShopException()
181 181
 	{
182
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Category\Standard' )
183
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
184
-			->setMethods( array( 'updateItems' ) )
182
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Category\Standard')
183
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
184
+			->setMethods(array('updateItems'))
185 185
 			->getMock();
186 186
 
187
-		$object->expects( $this->once() )->method( 'updateItems' )
188
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
187
+		$object->expects($this->once())->method('updateItems')
188
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
189 189
 
190
-		$object->setView( \TestHelperJqadm::getView() );
190
+		$object->setView(\TestHelperJqadm::getView());
191 191
 
192
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
192
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
193 193
 		$object->save();
194 194
 	}
195 195
 
196 196
 
197 197
 	public function testSearch()
198 198
 	{
199
-		$this->assertNull( $this->object->search() );
199
+		$this->assertNull($this->object->search());
200 200
 	}
201 201
 
202 202
 
203 203
 	public function testGetSubClient()
204 204
 	{
205
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
206
-		$this->object->getSubClient( 'invalid' );
205
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
206
+		$this->object->getSubClient('invalid');
207 207
 	}
208 208
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Download/StandardTest.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -19,48 +19,48 @@  discard block
 block discarded – undo
19 19
 	protected function setUp()
20 20
 	{
21 21
 		$this->view = \TestHelperJqadm::getView();
22
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMock('\Psr\Http\Message\ServerRequestInterface');
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
28 28
 
29
-		$this->object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Download\Standard' )
30
-			->setConstructorArgs( array( $this->context, $templatePaths ) )
31
-			->setMethods( array( 'storeFile' ) )
29
+		$this->object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Download\Standard')
30
+			->setConstructorArgs(array($this->context, $templatePaths))
31
+			->setMethods(array('storeFile'))
32 32
 			->getMock();
33
-		$this->object->setView( $this->view );
33
+		$this->object->setView($this->view);
34 34
 	}
35 35
 
36 36
 
37 37
 	protected function tearDown()
38 38
 	{
39
-		unset( $this->object );
39
+		unset($this->object);
40 40
 	}
41 41
 
42 42
 
43 43
 	public function testCreate()
44 44
 	{
45
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
45
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
46 46
 
47 47
 		$this->view->item = $manager->createItem();
48 48
 		$result = $this->object->create();
49 49
 
50
-		$this->assertContains( 'Download', $result );
51
-		$this->assertNull( $this->view->get( 'errors' ) );
50
+		$this->assertContains('Download', $result);
51
+		$this->assertNull($this->view->get('errors'));
52 52
 	}
53 53
 
54 54
 
55 55
 	public function testCopy()
56 56
 	{
57
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
57
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
58 58
 
59
-		$this->view->item = $manager->findItem( 'CNE', array( 'attribute' ) );
59
+		$this->view->item = $manager->findItem('CNE', array('attribute'));
60 60
 		$result = $this->object->copy();
61 61
 
62
-		$this->assertNull( $this->view->get( 'errors' ) );
63
-		$this->assertContains( 'Test URL', $result );
62
+		$this->assertNull($this->view->get('errors'));
63
+		$this->assertContains('Test URL', $result);
64 64
 	}
65 65
 
66 66
 
@@ -68,32 +68,32 @@  discard block
 block discarded – undo
68 68
 	{
69 69
 		$result = $this->object->delete();
70 70
 
71
-		$this->assertNull( $this->view->get( 'errors' ) );
72
-		$this->assertNull( $result );
71
+		$this->assertNull($this->view->get('errors'));
72
+		$this->assertNull($result);
73 73
 	}
74 74
 
75 75
 
76 76
 	public function testGet()
77 77
 	{
78
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
78
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
79 79
 
80
-		$this->view->item = $manager->findItem( 'CNE', array( 'attribute' ) );
80
+		$this->view->item = $manager->findItem('CNE', array('attribute'));
81 81
 		$result = $this->object->get();
82 82
 
83
-		$this->assertNull( $this->view->get( 'errors' ) );
84
-		$this->assertContains( 'Test URL', $result );
83
+		$this->assertNull($this->view->get('errors'));
84
+		$this->assertContains('Test URL', $result);
85 85
 	}
86 86
 
87 87
 
88 88
 	public function testSave()
89 89
 	{
90
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
90
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
91 91
 
92
-		$item = $manager->findItem( 'CNE' );
93
-		$item->setCode( 'jqadm-test-download' );
94
-		$item->setId( null );
92
+		$item = $manager->findItem('CNE');
93
+		$item->setCode('jqadm-test-download');
94
+		$item->setId(null);
95 95
 
96
-		$manager->saveItem( $item );
96
+		$manager->saveItem($item);
97 97
 
98 98
 
99 99
 		$param = array(
@@ -104,90 +104,90 @@  discard block
 block discarded – undo
104 104
 			),
105 105
 		);
106 106
 
107
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
108
-		$this->view->addHelper( 'param', $helper );
107
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
108
+		$this->view->addHelper('param', $helper);
109 109
 
110
-		$file = $this->getMock( '\Psr\Http\Message\UploadedFileInterface' );
111
-		$file->expects( $this->any() )->method( 'getError' )->will( $this->returnValue( UPLOAD_ERR_OK ) );
110
+		$file = $this->getMock('\Psr\Http\Message\UploadedFileInterface');
111
+		$file->expects($this->any())->method('getError')->will($this->returnValue(UPLOAD_ERR_OK));
112 112
 
113
-		$request = $this->getMock( '\Psr\Http\Message\ServerRequestInterface' );
114
-		$request->expects( $this->any() )->method( 'getUploadedFiles' )
115
-			->will( $this->returnValue( array( 'download' => array( 'file' => $file ) ) ) );
113
+		$request = $this->getMock('\Psr\Http\Message\ServerRequestInterface');
114
+		$request->expects($this->any())->method('getUploadedFiles')
115
+			->will($this->returnValue(array('download' => array('file' => $file))));
116 116
 
117
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request );
118
-		$this->view->addHelper( 'request', $helper );
117
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request);
118
+		$this->view->addHelper('request', $helper);
119 119
 
120 120
 		$this->view->item = $item;
121 121
 
122 122
 
123
-		$this->object->expects( $this->once() )->method( 'storeFile' )
124
-			->will( $this->returnValue( 'test/file.ext' ) );
123
+		$this->object->expects($this->once())->method('storeFile')
124
+			->will($this->returnValue('test/file.ext'));
125 125
 
126
-		$attributeStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Attribute\\Manager\\Standard' )
127
-			->setConstructorArgs( array( $this->context ) )
128
-			->setMethods( array( 'saveItem' ) )
126
+		$attributeStub = $this->getMockBuilder('\\Aimeos\\MShop\\Attribute\\Manager\\Standard')
127
+			->setConstructorArgs(array($this->context))
128
+			->setMethods(array('saveItem'))
129 129
 			->getMock();
130
-		$attributeStub->expects( $this->once() )->method( 'saveItem' );
131
-		\Aimeos\MShop\Factory::injectManager( $this->context, 'attribute', $attributeStub );
130
+		$attributeStub->expects($this->once())->method('saveItem');
131
+		\Aimeos\MShop\Factory::injectManager($this->context, 'attribute', $attributeStub);
132 132
 
133 133
 
134
-		\Aimeos\MShop\Factory::setCache( true );
134
+		\Aimeos\MShop\Factory::setCache(true);
135 135
 		$result = $this->object->save();
136
-		\Aimeos\MShop\Factory::setCache( false );
136
+		\Aimeos\MShop\Factory::setCache(false);
137 137
 
138 138
 
139
-		$item = $manager->getItem( $item->getId(), array( 'attribute' ) );
140
-		$manager->deleteItem( $item->getId() );
139
+		$item = $manager->getItem($item->getId(), array('attribute'));
140
+		$manager->deleteItem($item->getId());
141 141
 
142
-		$this->assertNull( $this->view->get( 'errors' ) );
143
-		$this->assertNull( $result );
144
-		$this->assertEquals( 1, count( $item->getListItems( 'attribute', 'hidden' ) ) );
142
+		$this->assertNull($this->view->get('errors'));
143
+		$this->assertNull($result);
144
+		$this->assertEquals(1, count($item->getListItems('attribute', 'hidden')));
145 145
 	}
146 146
 
147 147
 
148 148
 	public function testSaveException()
149 149
 	{
150
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Download\Standard' )
151
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
152
-			->setMethods( array( 'updateItems' ) )
150
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Download\Standard')
151
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
152
+			->setMethods(array('updateItems'))
153 153
 			->getMock();
154 154
 
155
-		$object->expects( $this->once() )->method( 'updateItems' )
156
-			->will( $this->throwException( new \Exception() ) );
155
+		$object->expects($this->once())->method('updateItems')
156
+			->will($this->throwException(new \Exception()));
157 157
 
158
-		$object->setView( \TestHelperJqadm::getView() );
158
+		$object->setView(\TestHelperJqadm::getView());
159 159
 
160
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
160
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
161 161
 		$object->save();
162 162
 	}
163 163
 
164 164
 
165 165
 	public function testSaveMShopException()
166 166
 	{
167
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Download\Standard' )
168
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
169
-			->setMethods( array( 'updateItems' ) )
167
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Download\Standard')
168
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
169
+			->setMethods(array('updateItems'))
170 170
 			->getMock();
171 171
 
172
-		$object->expects( $this->once() )->method( 'updateItems' )
173
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
172
+		$object->expects($this->once())->method('updateItems')
173
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
174 174
 
175
-		$object->setView( \TestHelperJqadm::getView() );
175
+		$object->setView(\TestHelperJqadm::getView());
176 176
 
177
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
177
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
178 178
 		$object->save();
179 179
 	}
180 180
 
181 181
 
182 182
 	public function testSearch()
183 183
 	{
184
-		$this->assertNull( $this->object->search() );
184
+		$this->assertNull($this->object->search());
185 185
 	}
186 186
 
187 187
 
188 188
 	public function testGetSubClient()
189 189
 	{
190
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
191
-		$this->object->getSubClient( 'invalid' );
190
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
191
+		$this->object->getSubClient('invalid');
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Characteristic/StandardTest.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertNull( $this->view->get( 'errors' ) );
44
-		$this->assertContains( 'attribute-list', $result );
43
+		$this->assertNull($this->view->get('errors'));
44
+		$this->assertContains('attribute-list', $result);
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'CNC' );
52
+		$this->view->item = $manager->findItem('CNC');
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'attribute-list', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('attribute-list', $result);
57 57
 	}
58 58
 
59 59
 
@@ -61,99 +61,99 @@  discard block
 block discarded – undo
61 61
 	{
62 62
 		$result = $this->object->delete();
63 63
 
64
-		$this->assertNull( $this->view->get( 'errors' ) );
65
-		$this->assertNull( $result );
64
+		$this->assertNull($this->view->get('errors'));
65
+		$this->assertNull($result);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGet()
70 70
 	{
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
72 72
 
73
-		$this->view->item = $manager->findItem( 'CNC' );
73
+		$this->view->item = $manager->findItem('CNC');
74 74
 		$result = $this->object->get();
75 75
 
76
-		$this->assertNull( $this->view->get( 'errors' ) );
77
-		$this->assertContains( 'attribute-list', $result );
76
+		$this->assertNull($this->view->get('errors'));
77
+		$this->assertContains('attribute-list', $result);
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testSave()
82 82
 	{
83
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
84
-		$attrManager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' );
83
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
84
+		$attrManager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute');
85 85
 
86
-		$item = $manager->findItem( 'CNC' );
87
-		$item->setCode( 'jqadm-test-characteristic' );
88
-		$item->setId( null );
86
+		$item = $manager->findItem('CNC');
87
+		$item->setCode('jqadm-test-characteristic');
88
+		$item->setId(null);
89 89
 
90
-		$manager->saveItem( $item );
90
+		$manager->saveItem($item);
91 91
 
92 92
 
93 93
 		$param = array(
94 94
 			'characteristic' => array(
95 95
 				'attribute' => array(
96
-					'product.lists.id' => array( '' ),
97
-					'product.lists.refid' => array( $attrManager->findItem( 'xs', array(), 'product', 'size' )->getId() ),
96
+					'product.lists.id' => array(''),
97
+					'product.lists.refid' => array($attrManager->findItem('xs', array(), 'product', 'size')->getId()),
98 98
 				),
99 99
 			),
100 100
 		);
101 101
 
102
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
103
-		$this->view->addHelper( 'param', $helper );
102
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
103
+		$this->view->addHelper('param', $helper);
104 104
 		$this->view->item = $item;
105 105
 
106 106
 		$result = $this->object->save();
107
-		$manager->deleteItem( $item->getId() );
107
+		$manager->deleteItem($item->getId());
108 108
 
109
-		$this->assertNull( $this->view->get( 'errors' ) );
110
-		$this->assertNull( $result );
109
+		$this->assertNull($this->view->get('errors'));
110
+		$this->assertNull($result);
111 111
 	}
112 112
 
113 113
 
114 114
 	public function testSaveException()
115 115
 	{
116
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Standard' )
117
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
118
-			->setMethods( array( 'getSubClients' ) )
116
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Standard')
117
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
118
+			->setMethods(array('getSubClients'))
119 119
 			->getMock();
120 120
 
121
-		$object->expects( $this->once() )->method( 'getSubClients' )
122
-			->will( $this->throwException( new \Exception() ) );
121
+		$object->expects($this->once())->method('getSubClients')
122
+			->will($this->throwException(new \Exception()));
123 123
 
124
-		$object->setView( \TestHelperJqadm::getView() );
124
+		$object->setView(\TestHelperJqadm::getView());
125 125
 
126
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
126
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
127 127
 		$object->save();
128 128
 	}
129 129
 
130 130
 
131 131
 	public function testSaveMShopException()
132 132
 	{
133
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Standard' )
134
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
135
-			->setMethods( array( 'getSubClients' ) )
133
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Standard')
134
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
135
+			->setMethods(array('getSubClients'))
136 136
 			->getMock();
137 137
 
138
-		$object->expects( $this->once() )->method( 'getSubClients' )
139
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
138
+		$object->expects($this->once())->method('getSubClients')
139
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
140 140
 
141
-		$object->setView( \TestHelperJqadm::getView() );
141
+		$object->setView(\TestHelperJqadm::getView());
142 142
 
143
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
143
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
144 144
 		$object->save();
145 145
 	}
146 146
 
147 147
 
148 148
 	public function testSearch()
149 149
 	{
150
-		$this->assertNull( $this->object->search() );
150
+		$this->assertNull($this->object->search());
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testGetSubClient()
155 155
 	{
156
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
157
-		$this->object->getSubClient( 'invalid' );
156
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
157
+		$this->object->getSubClient('invalid');
158 158
 	}
159 159
 }
Please login to merge, or discard this patch.
jqadm/tests/Admin/JQAdm/Product/Characteristic/Property/StandardTest.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Properties', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Properties', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'CNC' );
52
+		$this->view->item = $manager->findItem('CNC');
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'Properties', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('Properties', $result);
57 57
 	}
58 58
 
59 59
 
@@ -61,111 +61,111 @@  discard block
 block discarded – undo
61 61
 	{
62 62
 		$result = $this->object->delete();
63 63
 
64
-		$this->assertNull( $this->view->get( 'errors' ) );
65
-		$this->assertNull( $result );
64
+		$this->assertNull($this->view->get('errors'));
65
+		$this->assertNull($result);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGet()
70 70
 	{
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
72 72
 
73
-		$this->view->item = $manager->findItem( 'CNC' );
73
+		$this->view->item = $manager->findItem('CNC');
74 74
 		$result = $this->object->get();
75 75
 
76
-		$this->assertNull( $this->view->get( 'errors' ) );
77
-		$this->assertContains( 'Properties', $result );
76
+		$this->assertNull($this->view->get('errors'));
77
+		$this->assertContains('Properties', $result);
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testSave()
82 82
 	{
83
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
84
-		$propManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property' );
85
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/property/type' );
83
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
84
+		$propManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property');
85
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/property/type');
86 86
 
87
-		$item = $manager->findItem( 'CNC' );
88
-		$item->setCode( 'jqadm-test-property' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('CNC');
88
+		$item->setCode('jqadm-test-property');
89
+		$item->setId(null);
90 90
 
91
-		$manager->saveItem( $item );
91
+		$manager->saveItem($item);
92 92
 
93 93
 
94
-		$typeid = $typeManager->findItem( 'package-height', array(), 'product' )->getId();
94
+		$typeid = $typeManager->findItem('package-height', array(), 'product')->getId();
95 95
 
96 96
 		$param = array(
97 97
 			'characteristic' => array(
98 98
 				'property' => array(
99
-					'product.property.id' => array( '' ),
100
-					'product.property.typeid' => array( $typeid ),
101
-					'product.property.value' => array( '10.0' ),
99
+					'product.property.id' => array(''),
100
+					'product.property.typeid' => array($typeid),
101
+					'product.property.value' => array('10.0'),
102 102
 				),
103 103
 			),
104 104
 		);
105 105
 
106
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
107
-		$this->view->addHelper( 'param', $helper );
106
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
107
+		$this->view->addHelper('param', $helper);
108 108
 		$this->view->item = $item;
109 109
 
110 110
 		$result = $this->object->save();
111 111
 
112 112
 		$search = $propManager->createSearch();
113
-		$search->setConditions( $search->compare( '==', 'product.property.parentid', $item->getId() ) );
114
-		$items = $propManager->searchItems( $search );
113
+		$search->setConditions($search->compare('==', 'product.property.parentid', $item->getId()));
114
+		$items = $propManager->searchItems($search);
115 115
 
116
-		$manager->deleteItem( $item->getId() );
116
+		$manager->deleteItem($item->getId());
117 117
 
118
-		$this->assertNull( $this->view->get( 'errors' ) );
119
-		$this->assertNull( $result );
120
-		$this->assertEquals( 1, count( $items ) );
121
-		$this->assertEquals( null, reset( $items )->getLanguageId() );
122
-		$this->assertEquals( '10.0', reset( $items )->getValue() );
118
+		$this->assertNull($this->view->get('errors'));
119
+		$this->assertNull($result);
120
+		$this->assertEquals(1, count($items));
121
+		$this->assertEquals(null, reset($items)->getLanguageId());
122
+		$this->assertEquals('10.0', reset($items)->getValue());
123 123
 	}
124 124
 
125 125
 
126 126
 	public function testSaveException()
127 127
 	{
128
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard' )
129
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
130
-			->setMethods( array( 'updateItems' ) )
128
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard')
129
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
130
+			->setMethods(array('updateItems'))
131 131
 			->getMock();
132 132
 
133
-		$object->expects( $this->once() )->method( 'updateItems' )
134
-			->will( $this->throwException( new \Exception() ) );
133
+		$object->expects($this->once())->method('updateItems')
134
+			->will($this->throwException(new \Exception()));
135 135
 
136
-		$object->setView( \TestHelperJqadm::getView() );
136
+		$object->setView(\TestHelperJqadm::getView());
137 137
 
138
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
138
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
139 139
 		$object->save();
140 140
 	}
141 141
 
142 142
 
143 143
 	public function testSaveMShopException()
144 144
 	{
145
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard' )
146
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
147
-			->setMethods( array( 'updateItems' ) )
145
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard')
146
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
147
+			->setMethods(array('updateItems'))
148 148
 			->getMock();
149 149
 
150
-		$object->expects( $this->once() )->method( 'updateItems' )
151
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
150
+		$object->expects($this->once())->method('updateItems')
151
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
152 152
 
153
-		$object->setView( \TestHelperJqadm::getView() );
153
+		$object->setView(\TestHelperJqadm::getView());
154 154
 
155
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
155
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
156 156
 		$object->save();
157 157
 	}
158 158
 
159 159
 
160 160
 	public function testSearch()
161 161
 	{
162
-		$this->assertNull( $this->object->search() );
162
+		$this->assertNull($this->object->search());
163 163
 	}
164 164
 
165 165
 
166 166
 	public function testGetSubClient()
167 167
 	{
168
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
169
-		$this->object->getSubClient( 'invalid' );
168
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
169
+		$this->object->getSubClient('invalid');
170 170
 	}
171 171
 }
Please login to merge, or discard this patch.
jqadm/tests/Admin/JQAdm/Product/Characteristic/Attribute/StandardTest.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Attributes', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Attributes', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'CNC', array( 'attribute' ) );
52
+		$this->view->item = $manager->findItem('CNC', array('attribute'));
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'xs', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('xs', $result);
57 57
 	}
58 58
 
59 59
 
@@ -61,102 +61,102 @@  discard block
 block discarded – undo
61 61
 	{
62 62
 		$result = $this->object->delete();
63 63
 
64
-		$this->assertNull( $this->view->get( 'errors' ) );
65
-		$this->assertNull( $result );
64
+		$this->assertNull($this->view->get('errors'));
65
+		$this->assertNull($result);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGet()
70 70
 	{
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
72 72
 
73
-		$this->view->item = $manager->findItem( 'CNC', array( 'attribute' ) );
73
+		$this->view->item = $manager->findItem('CNC', array('attribute'));
74 74
 		$result = $this->object->get();
75 75
 
76
-		$this->assertNull( $this->view->get( 'errors' ) );
77
-		$this->assertContains( 'xs', $result );
76
+		$this->assertNull($this->view->get('errors'));
77
+		$this->assertContains('xs', $result);
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testSave()
82 82
 	{
83
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
84
-		$attrManager = \Aimeos\MShop\Factory::createManager( $this->context, 'attribute' );
83
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
84
+		$attrManager = \Aimeos\MShop\Factory::createManager($this->context, 'attribute');
85 85
 
86
-		$item = $manager->findItem( 'CNC' );
87
-		$item->setCode( 'jqadm-test-attribute' );
88
-		$item->setId( null );
86
+		$item = $manager->findItem('CNC');
87
+		$item->setCode('jqadm-test-attribute');
88
+		$item->setId(null);
89 89
 
90
-		$manager->saveItem( $item );
90
+		$manager->saveItem($item);
91 91
 
92 92
 
93 93
 		$param = array(
94 94
 			'characteristic' => array(
95 95
 				'attribute' => array(
96
-					'product.lists.id' => array( '' ),
97
-					'product.lists.refid' => array( $attrManager->findItem( 'xs', array(), 'product', 'size' )->getId() ),
96
+					'product.lists.id' => array(''),
97
+					'product.lists.refid' => array($attrManager->findItem('xs', array(), 'product', 'size')->getId()),
98 98
 				),
99 99
 			),
100 100
 		);
101 101
 
102
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
103
-		$this->view->addHelper( 'param', $helper );
102
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
103
+		$this->view->addHelper('param', $helper);
104 104
 		$this->view->item = $item;
105 105
 
106 106
 		$result = $this->object->save();
107 107
 
108
-		$item = $manager->getItem( $item->getId(), array( 'attribute' ) );
109
-		$manager->deleteItem( $item->getId() );
108
+		$item = $manager->getItem($item->getId(), array('attribute'));
109
+		$manager->deleteItem($item->getId());
110 110
 
111
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
113
-		$this->assertEquals( 1, count( $item->getListItems( 'attribute' ) ) );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113
+		$this->assertEquals(1, count($item->getListItems('attribute')));
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testSaveException()
118 118
 	{
119
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard' )
120
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
121
-			->setMethods( array( 'updateItems' ) )
119
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard')
120
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
121
+			->setMethods(array('updateItems'))
122 122
 			->getMock();
123 123
 
124
-		$object->expects( $this->once() )->method( 'updateItems' )
125
-			->will( $this->throwException( new \Exception() ) );
124
+		$object->expects($this->once())->method('updateItems')
125
+			->will($this->throwException(new \Exception()));
126 126
 
127
-		$object->setView( \TestHelperJqadm::getView() );
127
+		$object->setView(\TestHelperJqadm::getView());
128 128
 
129
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
129
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
130 130
 		$object->save();
131 131
 	}
132 132
 
133 133
 
134 134
 	public function testSaveMShopException()
135 135
 	{
136
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard' )
137
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
138
-			->setMethods( array( 'updateItems' ) )
136
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Characteristic\Attribute\Standard')
137
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
138
+			->setMethods(array('updateItems'))
139 139
 			->getMock();
140 140
 
141
-		$object->expects( $this->once() )->method( 'updateItems' )
142
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
141
+		$object->expects($this->once())->method('updateItems')
142
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
143 143
 
144
-		$object->setView( \TestHelperJqadm::getView() );
144
+		$object->setView(\TestHelperJqadm::getView());
145 145
 
146
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
146
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
147 147
 		$object->save();
148 148
 	}
149 149
 
150 150
 
151 151
 	public function testSearch()
152 152
 	{
153
-		$this->assertNull( $this->object->search() );
153
+		$this->assertNull($this->object->search());
154 154
 	}
155 155
 
156 156
 
157 157
 	public function testGetSubClient()
158 158
 	{
159
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
160
-		$this->object->getSubClient( 'invalid' );
159
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
160
+		$this->object->getSubClient('invalid');
161 161
 	}
162 162
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Bundle/StandardTest.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -22,39 +22,39 @@  discard block
 block discarded – undo
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
24 24
 
25
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Bundle\Standard( $this->context, $templatePaths );
26
-		$this->object->setView( $this->view );
25
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Bundle\Standard($this->context, $templatePaths);
26
+		$this->object->setView($this->view);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		unset( $this->object );
32
+		unset($this->object);
33 33
 	}
34 34
 
35 35
 
36 36
 	public function testCreate()
37 37
 	{
38
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
38
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
39 39
 
40 40
 		$this->view->item = $manager->createItem();
41 41
 		$result = $this->object->create();
42 42
 
43
-		$this->assertContains( 'Bundles', $result );
44
-		$this->assertNull( $this->view->get( 'errors' ) );
43
+		$this->assertContains('Bundles', $result);
44
+		$this->assertNull($this->view->get('errors'));
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopy()
49 49
 	{
50
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
50
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
51 51
 
52
-		$this->view->item = $manager->findItem( 'U:BUNDLE', array( 'product' ) );
52
+		$this->view->item = $manager->findItem('U:BUNDLE', array('product'));
53 53
 		$result = $this->object->copy();
54 54
 
55
-		$this->assertNull( $this->view->get( 'errors' ) );
56
-		$this->assertContains( 'Cafe Noire Cappuccino', $result );
57
-		$this->assertContains( 'Cafe Noire Expresso', $result );
55
+		$this->assertNull($this->view->get('errors'));
56
+		$this->assertContains('Cafe Noire Cappuccino', $result);
57
+		$this->assertContains('Cafe Noire Expresso', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,100 +62,100 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'U:BUNDLE', array( 'product' ) );
74
+		$this->view->item = $manager->findItem('U:BUNDLE', array('product'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Cafe Noire Cappuccino', $result );
79
-		$this->assertContains( 'Cafe Noire Expresso', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Cafe Noire Cappuccino', $result);
79
+		$this->assertContains('Cafe Noire Expresso', $result);
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testSave()
84 84
 	{
85
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
85
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
86 86
 
87
-		$item = $manager->findItem( 'U:BUNDLE' );
88
-		$item->setCode( 'jqadm-test-bundle' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('U:BUNDLE');
88
+		$item->setCode('jqadm-test-bundle');
89
+		$item->setId(null);
90 90
 
91
-		$manager->saveItem( $item );
91
+		$manager->saveItem($item);
92 92
 
93 93
 
94 94
 		$param = array(
95 95
 			'bundle' => array(
96
-				'product.lists.id' => array( '' ),
97
-				'product.lists.refid' => array( $manager->findItem( 'CNE' )->getId() ),
96
+				'product.lists.id' => array(''),
97
+				'product.lists.refid' => array($manager->findItem('CNE')->getId()),
98 98
 			),
99 99
 		);
100 100
 
101
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
102
-		$this->view->addHelper( 'param', $helper );
101
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
102
+		$this->view->addHelper('param', $helper);
103 103
 		$this->view->item = $item;
104 104
 
105 105
 		$result = $this->object->save();
106 106
 
107
-		$item = $manager->getItem( $item->getId(), array( 'product' ) );
108
-		$manager->deleteItem( $item->getId() );
107
+		$item = $manager->getItem($item->getId(), array('product'));
108
+		$manager->deleteItem($item->getId());
109 109
 
110
-		$this->assertNull( $this->view->get( 'errors' ) );
111
-		$this->assertNull( $result );
112
-		$this->assertEquals( 1, count( $item->getListItems( 'product' ) ) );
110
+		$this->assertNull($this->view->get('errors'));
111
+		$this->assertNull($result);
112
+		$this->assertEquals(1, count($item->getListItems('product')));
113 113
 	}
114 114
 
115 115
 
116 116
 	public function testSaveException()
117 117
 	{
118
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Bundle\Standard' )
119
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
120
-			->setMethods( array( 'updateItems' ) )
118
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Bundle\Standard')
119
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
120
+			->setMethods(array('updateItems'))
121 121
 			->getMock();
122 122
 
123
-		$object->expects( $this->once() )->method( 'updateItems' )
124
-			->will( $this->throwException( new \Exception() ) );
123
+		$object->expects($this->once())->method('updateItems')
124
+			->will($this->throwException(new \Exception()));
125 125
 
126
-		$object->setView( \TestHelperJqadm::getView() );
126
+		$object->setView(\TestHelperJqadm::getView());
127 127
 
128
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
128
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
129 129
 		$object->save();
130 130
 	}
131 131
 
132 132
 
133 133
 	public function testSaveMShopException()
134 134
 	{
135
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Bundle\Standard' )
136
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
137
-			->setMethods( array( 'updateItems' ) )
135
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Bundle\Standard')
136
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
137
+			->setMethods(array('updateItems'))
138 138
 			->getMock();
139 139
 
140
-		$object->expects( $this->once() )->method( 'updateItems' )
141
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
140
+		$object->expects($this->once())->method('updateItems')
141
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
142 142
 
143
-		$object->setView( \TestHelperJqadm::getView() );
143
+		$object->setView(\TestHelperJqadm::getView());
144 144
 
145
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
145
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
146 146
 		$object->save();
147 147
 	}
148 148
 
149 149
 
150 150
 	public function testSearch()
151 151
 	{
152
-		$this->assertNull( $this->object->search() );
152
+		$this->assertNull($this->object->search());
153 153
 	}
154 154
 
155 155
 
156 156
 	public function testGetSubClient()
157 157
 	{
158
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
159
-		$this->object->getSubClient( 'invalid' );
158
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
159
+		$this->object->getSubClient('invalid');
160 160
 	}
161 161
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Common/Decorator/BaseTest.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -17,83 +17,83 @@
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		$this->mock = $this->getMockBuilder( 'Aimeos\Admin\JQAdm\Product\Standard' )
21
-			->setMethods( array( 'copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient' ) )
20
+		$this->mock = $this->getMockBuilder('Aimeos\Admin\JQAdm\Product\Standard')
21
+			->setMethods(array('copy', 'create', 'delete', 'get', 'save', 'search', 'getSubClient'))
22 22
 			->disableOriginalConstructor()
23 23
 			->getMock();
24 24
 
25 25
 		$templatePaths = \TestHelperJqadm::getTemplatePaths();
26 26
 		$context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->mock, $context, $templatePaths );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->mock, $context, $templatePaths);
29 29
 	}
30 30
 
31 31
 
32 32
 	protected function tearDown()
33 33
 	{
34
-		unset( $this->object, $this->mock );
34
+		unset($this->object, $this->mock);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCallInvalid()
39 39
 	{
40
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
40
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
41 41
 		$this->object->invalidMethod();
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCopy()
46 46
 	{
47
-		$this->mock->expects( $this->once() )->method( 'copy' )->will( $this->returnValue( 'test' ) );
47
+		$this->mock->expects($this->once())->method('copy')->will($this->returnValue('test'));
48 48
 
49
-		$this->assertEquals( 'test', $this->object->copy() );
49
+		$this->assertEquals('test', $this->object->copy());
50 50
 	}
51 51
 
52 52
 
53 53
 	public function testCreate()
54 54
 	{
55
-		$this->mock->expects( $this->once() )->method( 'create' )->will( $this->returnValue( 'test' ) );
55
+		$this->mock->expects($this->once())->method('create')->will($this->returnValue('test'));
56 56
 
57
-		$this->assertEquals( 'test', $this->object->create() );
57
+		$this->assertEquals('test', $this->object->create());
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$this->mock->expects( $this->once() )->method( 'delete' )->will( $this->returnValue( 'test' ) );
63
+		$this->mock->expects($this->once())->method('delete')->will($this->returnValue('test'));
64 64
 
65
-		$this->assertEquals( 'test', $this->object->delete() );
65
+		$this->assertEquals('test', $this->object->delete());
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testGet()
70 70
 	{
71
-		$this->mock->expects( $this->once() )->method( 'get' )->will( $this->returnValue( 'test' ) );
71
+		$this->mock->expects($this->once())->method('get')->will($this->returnValue('test'));
72 72
 
73
-		$this->assertEquals( 'test', $this->object->get() );
73
+		$this->assertEquals('test', $this->object->get());
74 74
 	}
75 75
 
76 76
 
77 77
 	public function testSave()
78 78
 	{
79
-		$this->mock->expects( $this->once() )->method( 'save' )->will( $this->returnValue( 'test' ) );
79
+		$this->mock->expects($this->once())->method('save')->will($this->returnValue('test'));
80 80
 
81
-		$this->assertEquals( 'test', $this->object->save() );
81
+		$this->assertEquals('test', $this->object->save());
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSearch()
86 86
 	{
87
-		$this->mock->expects( $this->once() )->method( 'search' )->will( $this->returnValue( 'test' ) );
87
+		$this->mock->expects($this->once())->method('search')->will($this->returnValue('test'));
88 88
 
89
-		$this->assertEquals( 'test', $this->object->search() );
89
+		$this->assertEquals('test', $this->object->search());
90 90
 	}
91 91
 
92 92
 
93 93
 	public function testGetSubClient()
94 94
 	{
95
-		$this->mock->expects( $this->once() )->method( 'getSubClient' )->will( $this->returnValue( 'test' ) );
95
+		$this->mock->expects($this->once())->method('getSubClient')->will($this->returnValue('test'));
96 96
 
97
-		$this->assertEquals( 'test', $this->object->getSubClient( 'invalid' ) );
97
+		$this->assertEquals('test', $this->object->getSubClient('invalid'));
98 98
 	}
99 99
 }
Please login to merge, or discard this patch.