Completed
Push — master ( 521882...b49ab8 )
by Aimeos
04:07
created
admin/jqadm/tests/Admin/JQAdm/Locale/StandardTest.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -280,6 +280,9 @@  discard block
 block discarded – undo
280 280
 	}
281 281
 
282 282
 
283
+	/**
284
+	 * @param string $method
285
+	 */
283 286
 	public function getClientMock( $method )
284 287
 	{
285 288
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Standard::class )
@@ -312,6 +315,10 @@  discard block
 block discarded – undo
312 315
 	}
313 316
 
314 317
 
318
+	/**
319
+	 * @param string $langid
320
+	 * @param string $currid
321
+	 */
315 322
 	protected function getItem( $langid = null, $currid = null )
316 323
 	{
317 324
 		$manager = \Aimeos\MShop::create( $this->context, 'locale' );
Please login to merge, or discard this patch.
Spacing   +94 added lines, -94 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\Locale\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\Locale\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,10 +42,10 @@  discard block
 block discarded – undo
42 42
 
43 43
 	public function testCreateException()
44 44
 	{
45
-		$object = $this->getClientMock( 'getSubClients' );
45
+		$object = $this->getClientMock('getSubClients');
46 46
 
47
-		$object->expects( $this->once() )->method( 'getSubClients' )
48
-			->will( $this->throwException( new \RuntimeException() ) );
47
+		$object->expects($this->once())->method('getSubClients')
48
+			->will($this->throwException(new \RuntimeException()));
49 49
 
50 50
 		$object->create();
51 51
 	}
@@ -53,10 +53,10 @@  discard block
 block discarded – undo
53 53
 
54 54
 	public function testCreateMShopException()
55 55
 	{
56
-		$object = $this->getClientMock( 'getSubClients' );
56
+		$object = $this->getClientMock('getSubClients');
57 57
 
58
-		$object->expects( $this->once() )->method( 'getSubClients' )
59
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
58
+		$object->expects($this->once())->method('getSubClients')
59
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
60 60
 
61 61
 		$object->create();
62 62
 	}
@@ -64,22 +64,22 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function testCopy()
66 66
 	{
67
-		$param = ['site' => 'unittest', 'id' => $this->getItem( 'de', 'EUR' )->getId()];
68
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
69
-		$this->view->addHelper( 'param', $helper );
67
+		$param = ['site' => 'unittest', 'id' => $this->getItem('de', 'EUR')->getId()];
68
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
69
+		$this->view->addHelper('param', $helper);
70 70
 
71 71
 		$result = $this->object->copy();
72 72
 
73
-		$this->assertContains( 'EUR', $result );
73
+		$this->assertContains('EUR', $result);
74 74
 	}
75 75
 
76 76
 
77 77
 	public function testCopyException()
78 78
 	{
79
-		$object = $this->getClientMock( 'getSubClients' );
79
+		$object = $this->getClientMock('getSubClients');
80 80
 
81
-		$object->expects( $this->once() )->method( 'getSubClients' )
82
-			->will( $this->throwException( new \RuntimeException() ) );
81
+		$object->expects($this->once())->method('getSubClients')
82
+			->will($this->throwException(new \RuntimeException()));
83 83
 
84 84
 		$object->copy();
85 85
 	}
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
 
88 88
 	public function testCopyMShopException()
89 89
 	{
90
-		$object = $this->getClientMock( 'getSubClients' );
90
+		$object = $this->getClientMock('getSubClients');
91 91
 
92
-		$object->expects( $this->once() )->method( 'getSubClients' )
93
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
92
+		$object->expects($this->once())->method('getSubClients')
93
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
94 94
 
95 95
 		$object->copy();
96 96
 	}
@@ -98,16 +98,16 @@  discard block
 block discarded – undo
98 98
 
99 99
 	public function testDelete()
100 100
 	{
101
-		$this->assertNotNull( $this->object->delete() );
101
+		$this->assertNotNull($this->object->delete());
102 102
 	}
103 103
 
104 104
 
105 105
 	public function testDeleteException()
106 106
 	{
107
-		$object = $this->getClientMock( 'getSubClients' );
107
+		$object = $this->getClientMock('getSubClients');
108 108
 
109
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
110
-			->will( $this->throwException( new \RuntimeException() ) );
109
+		$object->expects($this->exactly(2))->method('getSubClients')
110
+			->will($this->throwException(new \RuntimeException()));
111 111
 
112 112
 		$object->delete();
113 113
 	}
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
 
116 116
 	public function testDeleteMShopException()
117 117
 	{
118
-		$object = $this->getClientMock( 'getSubClients' );
118
+		$object = $this->getClientMock('getSubClients');
119 119
 
120
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
121
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
120
+		$object->expects($this->exactly(2))->method('getSubClients')
121
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
122 122
 
123 123
 		$object->delete();
124 124
 	}
@@ -126,22 +126,22 @@  discard block
 block discarded – undo
126 126
 
127 127
 	public function testGet()
128 128
 	{
129
-		$param = ['site' => 'unittest', 'id' => $this->getItem( 'de', 'EUR' )->getId()];
130
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
131
-		$this->view->addHelper( 'param', $helper );
129
+		$param = ['site' => 'unittest', 'id' => $this->getItem('de', 'EUR')->getId()];
130
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
131
+		$this->view->addHelper('param', $helper);
132 132
 
133 133
 		$result = $this->object->get();
134 134
 
135
-		$this->assertContains( 'EUR', $result );
135
+		$this->assertContains('EUR', $result);
136 136
 	}
137 137
 
138 138
 
139 139
 	public function testGetException()
140 140
 	{
141
-		$object = $this->getClientMock( 'getSubClients' );
141
+		$object = $this->getClientMock('getSubClients');
142 142
 
143
-		$object->expects( $this->once() )->method( 'getSubClients' )
144
-			->will( $this->throwException( new \RuntimeException() ) );
143
+		$object->expects($this->once())->method('getSubClients')
144
+			->will($this->throwException(new \RuntimeException()));
145 145
 
146 146
 		$object->get();
147 147
 	}
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
 
150 150
 	public function testGetMShopException()
151 151
 	{
152
-		$object = $this->getClientMock( 'getSubClients' );
152
+		$object = $this->getClientMock('getSubClients');
153 153
 
154
-		$object->expects( $this->once() )->method( 'getSubClients' )
155
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
154
+		$object->expects($this->once())->method('getSubClients')
155
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
156 156
 
157 157
 		$object->get();
158 158
 	}
@@ -160,16 +160,16 @@  discard block
 block discarded – undo
160 160
 
161 161
 	public function testGetViewException()
162 162
 	{
163
-		$object = new \Aimeos\Admin\JQAdm\Locale\Standard( $this->context, [] );
163
+		$object = new \Aimeos\Admin\JQAdm\Locale\Standard($this->context, []);
164 164
 
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166 166
 		$object->getView();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSave()
171 171
 	{
172
-		$manager = \Aimeos\MShop::create( $this->context, 'locale' );
172
+		$manager = \Aimeos\MShop::create($this->context, 'locale');
173 173
 
174 174
 		$param = array(
175 175
 			'site' => 'unittest',
@@ -182,21 +182,21 @@  discard block
 block discarded – undo
182 182
 			),
183 183
 		);
184 184
 
185
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
186
-		$this->view->addHelper( 'param', $helper );
185
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
186
+		$this->view->addHelper('param', $helper);
187 187
 
188 188
 		$this->object->save();
189 189
 
190
-		$manager->deleteItem( $this->getItem( 'da', 'DKK' )->getId() );
190
+		$manager->deleteItem($this->getItem('da', 'DKK')->getId());
191 191
 	}
192 192
 
193 193
 
194 194
 	public function testSaveException()
195 195
 	{
196
-		$object = $this->getClientMock( 'fromArray' );
196
+		$object = $this->getClientMock('fromArray');
197 197
 
198
-		$object->expects( $this->once() )->method( 'fromArray' )
199
-			->will( $this->throwException( new \RuntimeException() ) );
198
+		$object->expects($this->once())->method('fromArray')
199
+			->will($this->throwException(new \RuntimeException()));
200 200
 
201 201
 		$object->save();
202 202
 	}
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
 
205 205
 	public function testSaveMShopException()
206 206
 	{
207
-		$object = $this->getClientMock( 'fromArray' );
207
+		$object = $this->getClientMock('fromArray');
208 208
 
209
-		$object->expects( $this->once() )->method( 'fromArray' )
210
-			->will( $this->throwException( new \RuntimeException() ) );
209
+		$object->expects($this->once())->method('fromArray')
210
+			->will($this->throwException(new \RuntimeException()));
211 211
 
212 212
 		$object->save();
213 213
 	}
@@ -215,10 +215,10 @@  discard block
 block discarded – undo
215 215
 
216 216
 	public function testSaveJQAdmException()
217 217
 	{
218
-		$object = $this->getClientMock( 'fromArray' );
218
+		$object = $this->getClientMock('fromArray');
219 219
 
220
-		$object->expects( $this->once() )->method( 'fromArray' )
221
-			->will( $this->throwException( new \RuntimeException() ) );
220
+		$object->expects($this->once())->method('fromArray')
221
+			->will($this->throwException(new \RuntimeException()));
222 222
 
223 223
 		$object->save();
224 224
 	}
@@ -229,27 +229,27 @@  discard block
 block discarded – undo
229 229
 		$param = array(
230 230
 			'site' => 'unittest', 'lang' => 'de',
231 231
 			'filter' => array(
232
-				'key' => array( 0 => 'locale.languageid' ),
233
-				'op' => array( 0 => '==' ),
234
-				'val' => array( 0 => 'de' ),
232
+				'key' => array(0 => 'locale.languageid'),
233
+				'op' => array(0 => '=='),
234
+				'val' => array(0 => 'de'),
235 235
 			),
236
-			'sort' => array( 'locale.position', '-locale.id' ),
236
+			'sort' => array('locale.position', '-locale.id'),
237 237
 		);
238
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
239
-		$this->view->addHelper( 'param', $helper );
238
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
239
+		$this->view->addHelper('param', $helper);
240 240
 
241 241
 		$result = $this->object->search();
242 242
 
243
-		$this->assertContains( '>EUR<', $result );
243
+		$this->assertContains('>EUR<', $result);
244 244
 	}
245 245
 
246 246
 
247 247
 	public function testSearchException()
248 248
 	{
249
-		$object = $this->getClientMock( 'initCriteria' );
249
+		$object = $this->getClientMock('initCriteria');
250 250
 
251
-		$object->expects( $this->once() )->method( 'initCriteria' )
252
-			->will( $this->throwException( new \RuntimeException() ) );
251
+		$object->expects($this->once())->method('initCriteria')
252
+			->will($this->throwException(new \RuntimeException()));
253 253
 
254 254
 		$object->search();
255 255
 	}
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
 
258 258
 	public function testSearchMShopException()
259 259
 	{
260
-		$object = $this->getClientMock( 'initCriteria' );
260
+		$object = $this->getClientMock('initCriteria');
261 261
 
262
-		$object->expects( $this->once() )->method( 'initCriteria' )
263
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
262
+		$object->expects($this->once())->method('initCriteria')
263
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
264 264
 
265 265
 		$object->search();
266 266
 	}
@@ -268,27 +268,27 @@  discard block
 block discarded – undo
268 268
 
269 269
 	public function testGetSubClientInvalid()
270 270
 	{
271
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
272
-		$this->object->getSubClient( '$unknown$' );
271
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
272
+		$this->object->getSubClient('$unknown$');
273 273
 	}
274 274
 
275 275
 
276 276
 	public function testGetSubClientUnknown()
277 277
 	{
278
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
279
-		$this->object->getSubClient( 'unknown' );
278
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
279
+		$this->object->getSubClient('unknown');
280 280
 	}
281 281
 
282 282
 
283
-	public function getClientMock( $method )
283
+	public function getClientMock($method)
284 284
 	{
285
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Standard::class )
286
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
287
-			->setMethods( [$method] )
285
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Standard::class)
286
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
287
+			->setMethods([$method])
288 288
 			->getMock();
289 289
 
290
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
291
-		$object->setView( $this->getViewNoRender() );
290
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
291
+		$object->setView($this->getViewNoRender());
292 292
 
293 293
 		return $object;
294 294
 	}
@@ -296,45 +296,45 @@  discard block
 block discarded – undo
296 296
 
297 297
 	protected function getViewNoRender()
298 298
 	{
299
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
300
-			->setConstructorArgs( array( [] ) )
301
-			->setMethods( array( 'render', 'config' ) )
299
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
300
+			->setConstructorArgs(array([]))
301
+			->setMethods(array('render', 'config'))
302 302
 			->getMock();
303 303
 
304 304
 		$param = ['site' => 'unittest', 'id' => $this->getItem()->getId()];
305
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
306
-		$view->addHelper( 'param', $helper );
305
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
306
+		$view->addHelper('param', $helper);
307 307
 
308
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
309
-		$view->addHelper( 'access', $helper );
308
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
309
+		$view->addHelper('access', $helper);
310 310
 
311 311
 		return $view;
312 312
 	}
313 313
 
314 314
 
315
-	protected function getItem( $langid = null, $currid = null )
315
+	protected function getItem($langid = null, $currid = null)
316 316
 	{
317
-		$manager = \Aimeos\MShop::create( $this->context, 'locale' );
317
+		$manager = \Aimeos\MShop::create($this->context, 'locale');
318 318
 
319 319
 		$search = $manager->createSearch();
320
-		$search->setSlice( 0, 1 );
320
+		$search->setSlice(0, 1);
321 321
 
322 322
 		$expr = [];
323 323
 
324
-		if( $langid ) {
325
-			$expr[] = $search->compare( '==', 'locale.languageid', $langid );
324
+		if ($langid) {
325
+			$expr[] = $search->compare('==', 'locale.languageid', $langid);
326 326
 		}
327 327
 
328
-		if( $currid ) {
329
-			$expr[] = $search->compare( '==', 'locale.currencyid', $currid );
328
+		if ($currid) {
329
+			$expr[] = $search->compare('==', 'locale.currencyid', $currid);
330 330
 		}
331 331
 
332
-		$search->setConditions( $search->combine( '&&', $expr ) );
332
+		$search->setConditions($search->combine('&&', $expr));
333 333
 
334
-		$items = $manager->searchItems( $search );
334
+		$items = $manager->searchItems($search);
335 335
 
336
-		if( ( $item = reset( $items ) ) === false ) {
337
-			throw new \Exception( sprintf( 'No locale found' ) );
336
+		if (($item = reset($items)) === false) {
337
+			throw new \Exception(sprintf('No locale found'));
338 338
 		}
339 339
 
340 340
 		return $item;
Please login to merge, or discard this patch.
admin/jqadm/tests/TestHelperJqadm.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -83,6 +83,9 @@
 block discarded – undo
83 83
 	}
84 84
 
85 85
 
86
+	/**
87
+	 * @return Aimeos\Bootstrap
88
+	 */
86 89
 	public static function getAimeos()
87 90
 	{
88 91
 		if( !isset( self::$aimeos ) )
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -13,63 +13,63 @@  discard block
 block discarded – undo
13 13
 	public static function bootstrap()
14 14
 	{
15 15
 		self::getAimeos();
16
-		\Aimeos\MShop::cache( false );
16
+		\Aimeos\MShop::cache(false);
17 17
 	}
18 18
 
19 19
 
20
-	public static function getContext( $site = 'unittest' )
20
+	public static function getContext($site = 'unittest')
21 21
 	{
22
-		if( !isset( self::$context[$site] ) ) {
23
-			self::$context[$site] = self::createContext( $site );
22
+		if (!isset(self::$context[$site])) {
23
+			self::$context[$site] = self::createContext($site);
24 24
 		}
25 25
 
26 26
 		return clone self::$context[$site];
27 27
 	}
28 28
 
29 29
 
30
-	public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null )
30
+	public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null)
31 31
 	{
32
-		if( $config === null ) {
33
-			$config = self::getContext( $site )->getConfig();
32
+		if ($config === null) {
33
+			$config = self::getContext($site)->getConfig();
34 34
 		}
35 35
 
36
-		$view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() );
36
+		$view = new \Aimeos\MW\View\Standard(self::getTemplatePaths());
37 37
 
38
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, ['site' => 'unittest'] );
39
-		$view->addHelper( 'param', $helper );
38
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, ['site' => 'unittest']);
39
+		$view->addHelper('param', $helper);
40 40
 
41
-		$trans = new \Aimeos\MW\Translation\None( 'de_DE' );
42
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans );
43
-		$view->addHelper( 'translate', $helper );
41
+		$trans = new \Aimeos\MW\Translation\None('de_DE');
42
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans);
43
+		$view->addHelper('translate', $helper);
44 44
 
45
-		$helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' );
46
-		$view->addHelper( 'url', $helper );
45
+		$helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl');
46
+		$view->addHelper('url', $helper);
47 47
 
48
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' );
49
-		$view->addHelper( 'number', $helper );
48
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', '');
49
+		$view->addHelper('number', $helper);
50 50
 
51
-		$helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' );
52
-		$view->addHelper( 'date', $helper );
51
+		$helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d');
52
+		$view->addHelper('date', $helper);
53 53
 
54
-		$config = new \Aimeos\MW\Config\Decorator\Protect( $config, ['admin', 'resource/fs/baseurl'] );
55
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
56
-		$view->addHelper( 'config', $helper );
54
+		$config = new \Aimeos\MW\Config\Decorator\Protect($config, ['admin', 'resource/fs/baseurl']);
55
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
56
+		$view->addHelper('config', $helper);
57 57
 
58
-		$helper = new \Aimeos\MW\View\Helper\Session\Standard( $view, new \Aimeos\MW\Session\None() );
59
-		$view->addHelper( 'session', $helper );
58
+		$helper = new \Aimeos\MW\View\Helper\Session\Standard($view, new \Aimeos\MW\Session\None());
59
+		$view->addHelper('session', $helper);
60 60
 
61
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $view, new \Zend\Diactoros\ServerRequest() );
62
-		$view->addHelper( 'request', $helper );
61
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($view, new \Zend\Diactoros\ServerRequest());
62
+		$view->addHelper('request', $helper);
63 63
 
64
-		$helper = new \Aimeos\MW\View\Helper\Response\Standard( $view, new \Zend\Diactoros\Response() );
65
-		$view->addHelper( 'response', $helper );
64
+		$helper = new \Aimeos\MW\View\Helper\Response\Standard($view, new \Zend\Diactoros\Response());
65
+		$view->addHelper('response', $helper);
66 66
 
67
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' );
68
-		$view->addHelper( 'csrf', $helper );
67
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value');
68
+		$view->addHelper('csrf', $helper);
69 69
 
70
-		$fcn = function() { return array( 'admin' ); };
71
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn );
72
-		$view->addHelper( 'access', $helper );
70
+		$fcn = function() { return array('admin'); };
71
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn);
72
+		$view->addHelper('access', $helper);
73 73
 
74 74
 		$view->pageSitePath = [];
75 75
 
@@ -79,19 +79,19 @@  discard block
 block discarded – undo
79 79
 
80 80
 	public static function getTemplatePaths()
81 81
 	{
82
-		return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' );
82
+		return self::getAimeos()->getCustomPaths('admin/jqadm/templates');
83 83
 	}
84 84
 
85 85
 
86 86
 	public static function getAimeos()
87 87
 	{
88
-		if( !isset( self::$aimeos ) )
88
+		if (!isset(self::$aimeos))
89 89
 		{
90 90
 			require_once 'Bootstrap.php';
91
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
91
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
92 92
 
93
-			$extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
94
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
93
+			$extdir = dirname(dirname(dirname(dirname(__FILE__))));
94
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
95 95
 		}
96 96
 
97 97
 		return self::$aimeos;
@@ -101,57 +101,57 @@  discard block
 block discarded – undo
101 101
 	/**
102 102
 	 * @param string $site
103 103
 	 */
104
-	private static function createContext( $site )
104
+	private static function createContext($site)
105 105
 	{
106 106
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
107 107
 		$aimeos = self::getAimeos();
108 108
 
109 109
 
110
-		$paths = $aimeos->getConfigPaths( 'mysql' );
110
+		$paths = $aimeos->getConfigPaths('mysql');
111 111
 		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
112 112
 		$file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser';
113
-		$local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) );
113
+		$local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp')));
114 114
 
115
-		$conf = new \Aimeos\MW\Config\PHPArray( $local, $paths );
116
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
117
-		$conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file );
118
-		$ctx->setConfig( $conf );
115
+		$conf = new \Aimeos\MW\Config\PHPArray($local, $paths);
116
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
117
+		$conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file);
118
+		$ctx->setConfig($conf);
119 119
 
120 120
 
121
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
122
-		$ctx->setDatabaseManager( $dbm );
121
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
122
+		$ctx->setDatabaseManager($dbm);
123 123
 
124 124
 
125
-		$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf );
126
-		$ctx->setFilesystemManager( $fs );
125
+		$fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf);
126
+		$ctx->setFilesystemManager($fs);
127 127
 
128 128
 
129
-		$mq = new \Aimeos\MW\MQueue\Manager\Standard( $conf );
130
-		$ctx->setMessageQueueManager( $mq );
129
+		$mq = new \Aimeos\MW\MQueue\Manager\Standard($conf);
130
+		$ctx->setMessageQueueManager($mq);
131 131
 
132 132
 
133
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
134
-		$ctx->setLogger( $logger );
133
+		$logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG);
134
+		$ctx->setLogger($logger);
135 135
 
136 136
 
137 137
 		$cache = new \Aimeos\MW\Cache\None();
138
-		$ctx->setCache( $cache );
138
+		$ctx->setCache($cache);
139 139
 
140 140
 
141
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
142
-		$ctx->setI18n( array( 'de' => $i18n ) );
141
+		$i18n = new \Aimeos\MW\Translation\None('de');
142
+		$ctx->setI18n(array('de' => $i18n));
143 143
 
144 144
 
145 145
 		$session = new \Aimeos\MW\Session\None();
146
-		$ctx->setSession( $session );
146
+		$ctx->setSession($session);
147 147
 
148 148
 
149
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $ctx );
150
-		$locale = $localeManager->bootstrap( $site, '', '', false );
151
-		$ctx->setLocale( $locale );
149
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create($ctx);
150
+		$locale = $localeManager->bootstrap($site, '', '', false);
151
+		$ctx->setLocale($locale);
152 152
 
153 153
 
154
-		$ctx->setEditor( 'ai-admin-jqadm:admin/jqadm' );
154
+		$ctx->setEditor('ai-admin-jqadm:admin/jqadm');
155 155
 
156 156
 		return $ctx;
157 157
 	}
Please login to merge, or discard this patch.
lib/custom/tests/TestHelperCustom.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -13,55 +13,55 @@  discard block
 block discarded – undo
13 13
 	public static function bootstrap()
14 14
 	{
15 15
 		self::getAimeos();
16
-		\Aimeos\MShop::cache( false );
16
+		\Aimeos\MShop::cache(false);
17 17
 	}
18 18
 
19 19
 
20
-	public static function getContext( $site = 'unittest' )
20
+	public static function getContext($site = 'unittest')
21 21
 	{
22
-		if( !isset( self::$context[$site] ) ) {
23
-			self::$context[$site] = self::createContext( $site );
22
+		if (!isset(self::$context[$site])) {
23
+			self::$context[$site] = self::createContext($site);
24 24
 		}
25 25
 
26 26
 		return clone self::$context[$site];
27 27
 	}
28 28
 
29 29
 
30
-	public static function getView( $site = 'unittest', \Aimeos\MW\Config\Iface $config = null )
30
+	public static function getView($site = 'unittest', \Aimeos\MW\Config\Iface $config = null)
31 31
 	{
32
-		if( $config === null ) {
33
-			$config = self::getContext( $site )->getConfig();
32
+		if ($config === null) {
33
+			$config = self::getContext($site)->getConfig();
34 34
 		}
35 35
 
36
-		$view = new \Aimeos\MW\View\Standard( self::getTemplatePaths() );
36
+		$view = new \Aimeos\MW\View\Standard(self::getTemplatePaths());
37 37
 
38 38
 		$param = ['site' => 'unittest'];
39
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
40
-		$view->addHelper( 'param', $helper );
39
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
40
+		$view->addHelper('param', $helper);
41 41
 
42
-		$trans = new \Aimeos\MW\Translation\None( 'de_DE' );
43
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans );
44
-		$view->addHelper( 'translate', $helper );
42
+		$trans = new \Aimeos\MW\Translation\None('de_DE');
43
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans);
44
+		$view->addHelper('translate', $helper);
45 45
 
46
-		$helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' );
47
-		$view->addHelper( 'url', $helper );
46
+		$helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl');
47
+		$view->addHelper('url', $helper);
48 48
 
49
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' );
50
-		$view->addHelper( 'number', $helper );
49
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', '');
50
+		$view->addHelper('number', $helper);
51 51
 
52
-		$helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' );
53
-		$view->addHelper( 'date', $helper );
52
+		$helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d');
53
+		$view->addHelper('date', $helper);
54 54
 
55
-		$config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin', 'client/html', 'controller/jsonadm' ) );
56
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
57
-		$view->addHelper( 'config', $helper );
55
+		$config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin', 'client/html', 'controller/jsonadm'));
56
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
57
+		$view->addHelper('config', $helper);
58 58
 
59
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_csrf_token', '_csrf_value' );
60
-		$view->addHelper( 'csrf', $helper );
59
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_csrf_token', '_csrf_value');
60
+		$view->addHelper('csrf', $helper);
61 61
 
62
-		$fcn = function() { return array( 'admin' ); };
63
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $fcn );
64
-		$view->addHelper( 'access', $helper );
62
+		$fcn = function() { return array('admin'); };
63
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $fcn);
64
+		$view->addHelper('access', $helper);
65 65
 
66 66
 		return $view;
67 67
 	}
@@ -69,19 +69,19 @@  discard block
 block discarded – undo
69 69
 
70 70
 	public static function getTemplatePaths()
71 71
 	{
72
-		return self::getAimeos()->getCustomPaths( 'admin/jqadm/templates' );
72
+		return self::getAimeos()->getCustomPaths('admin/jqadm/templates');
73 73
 	}
74 74
 
75 75
 
76 76
 	private static function getAimeos()
77 77
 	{
78
-		if( !isset( self::$aimeos ) )
78
+		if (!isset(self::$aimeos))
79 79
 		{
80 80
 			require_once 'Bootstrap.php';
81
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
81
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
82 82
 
83
-			$extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
84
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
83
+			$extdir = dirname(dirname(dirname(dirname(__FILE__))));
84
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
85 85
 		}
86 86
 
87 87
 		return self::$aimeos;
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	/**
92 92
 	 * @param string $site
93 93
 	 */
94
-	private static function createContext( $site )
94
+	private static function createContext($site)
95 95
 	{
96 96
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
97 97
 		$aimeos = self::getAimeos();
@@ -100,44 +100,44 @@  discard block
 block discarded – undo
100 100
 		$paths = $aimeos->getConfigPaths();
101 101
 		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
102 102
 		$file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser';
103
-		$local = array( 'resource' => array( 'fs' => array( 'adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp' ) ) );
103
+		$local = array('resource' => array('fs' => array('adapter' => 'Standard', 'basedir' => __DIR__ . '/tmp')));
104 104
 
105
-		$conf = new \Aimeos\MW\Config\PHPArray( $local, $paths );
106
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
107
-		$conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file );
108
-		$ctx->setConfig( $conf );
105
+		$conf = new \Aimeos\MW\Config\PHPArray($local, $paths);
106
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
107
+		$conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file);
108
+		$ctx->setConfig($conf);
109 109
 
110 110
 
111
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
112
-		$ctx->setDatabaseManager( $dbm );
111
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
112
+		$ctx->setDatabaseManager($dbm);
113 113
 
114 114
 
115
-		$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $conf );
116
-		$ctx->setFilesystemManager( $fs );
115
+		$fs = new \Aimeos\MW\Filesystem\Manager\Standard($conf);
116
+		$ctx->setFilesystemManager($fs);
117 117
 
118 118
 
119
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
120
-		$ctx->setLogger( $logger );
119
+		$logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG);
120
+		$ctx->setLogger($logger);
121 121
 
122 122
 
123 123
 		$cache = new \Aimeos\MW\Cache\None();
124
-		$ctx->setCache( $cache );
124
+		$ctx->setCache($cache);
125 125
 
126 126
 
127
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
128
-		$ctx->setI18n( array( 'de' => $i18n ) );
127
+		$i18n = new \Aimeos\MW\Translation\None('de');
128
+		$ctx->setI18n(array('de' => $i18n));
129 129
 
130 130
 
131 131
 		$session = new \Aimeos\MW\Session\None();
132
-		$ctx->setSession( $session );
132
+		$ctx->setSession($session);
133 133
 
134 134
 
135
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create( $ctx );
136
-		$locale = $localeManager->bootstrap( $site, '', '', false );
137
-		$ctx->setLocale( $locale );
135
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::create($ctx);
136
+		$locale = $localeManager->bootstrap($site, '', '', false);
137
+		$ctx->setLocale($locale);
138 138
 
139 139
 
140
-		$ctx->setEditor( 'ai-admin-jqadm:lib/custom' );
140
+		$ctx->setEditor('ai-admin-jqadm:lib/custom');
141 141
 
142 142
 		return $ctx;
143 143
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Catalog/Product/StandardTest.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -21,41 +21,41 @@  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\Catalog\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\Catalog\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
 
37 37
 	public function testCopy()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
40
-		$this->view->item = $manager->findItem( 'cafe' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
40
+		$this->view->item = $manager->findItem('cafe');
41 41
 
42 42
 		$result = $this->object->copy();
43 43
 
44
-		$this->assertContains( 'item-product', $result );
44
+		$this->assertContains('item-product', $result);
45 45
 	}
46 46
 
47 47
 
48 48
 	public function testCopyException()
49 49
 	{
50
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
51
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
52
-			->setMethods( array( 'getSubClients' ) )
50
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
51
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
52
+			->setMethods(array('getSubClients'))
53 53
 			->getMock();
54 54
 
55
-		$object->expects( $this->once() )->method( 'getSubClients' )
56
-			->will( $this->throwException( new \RuntimeException() ) );
55
+		$object->expects($this->once())->method('getSubClients')
56
+			->will($this->throwException(new \RuntimeException()));
57 57
 
58
-		$object->setView( $this->getViewNoRender() );
58
+		$object->setView($this->getViewNoRender());
59 59
 
60 60
 		$object->copy();
61 61
 	}
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
 
64 64
 	public function testCopyMShopException()
65 65
 	{
66
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
67
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
68
-			->setMethods( array( 'getSubClients' ) )
66
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
67
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
68
+			->setMethods(array('getSubClients'))
69 69
 			->getMock();
70 70
 
71
-		$object->expects( $this->once() )->method( 'getSubClients' )
72
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
71
+		$object->expects($this->once())->method('getSubClients')
72
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
73 73
 
74
-		$object->setView( $this->getViewNoRender() );
74
+		$object->setView($this->getViewNoRender());
75 75
 
76 76
 		$object->copy();
77 77
 	}
@@ -79,26 +79,26 @@  discard block
 block discarded – undo
79 79
 
80 80
 	public function testCreate()
81 81
 	{
82
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
83
-		$this->view->item = $manager->findItem( 'cafe' );
82
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
83
+		$this->view->item = $manager->findItem('cafe');
84 84
 
85 85
 		$result = $this->object->create();
86 86
 
87
-		$this->assertContains( 'item-product', $result );
87
+		$this->assertContains('item-product', $result);
88 88
 	}
89 89
 
90 90
 
91 91
 	public function testCreateException()
92 92
 	{
93
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
94
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
95
-			->setMethods( array( 'getSubClients' ) )
93
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
94
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
95
+			->setMethods(array('getSubClients'))
96 96
 			->getMock();
97 97
 
98
-		$object->expects( $this->once() )->method( 'getSubClients' )
99
-			->will( $this->throwException( new \RuntimeException() ) );
98
+		$object->expects($this->once())->method('getSubClients')
99
+			->will($this->throwException(new \RuntimeException()));
100 100
 
101
-		$object->setView( $this->getViewNoRender() );
101
+		$object->setView($this->getViewNoRender());
102 102
 
103 103
 		$object->create();
104 104
 	}
@@ -106,15 +106,15 @@  discard block
 block discarded – undo
106 106
 
107 107
 	public function testCreateMShopException()
108 108
 	{
109
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
110
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
111
-			->setMethods( array( 'getSubClients' ) )
109
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
110
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
111
+			->setMethods(array('getSubClients'))
112 112
 			->getMock();
113 113
 
114
-		$object->expects( $this->once() )->method( 'getSubClients' )
115
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
114
+		$object->expects($this->once())->method('getSubClients')
115
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
116 116
 
117
-		$object->setView( $this->getViewNoRender() );
117
+		$object->setView($this->getViewNoRender());
118 118
 
119 119
 		$object->create();
120 120
 	}
@@ -122,27 +122,27 @@  discard block
 block discarded – undo
122 122
 
123 123
 	public function testGet()
124 124
 	{
125
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
126
-		$this->view->item = $manager->findItem( 'cafe' );
125
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
126
+		$this->view->item = $manager->findItem('cafe');
127 127
 
128 128
 		$result = $this->object->get();
129 129
 
130
-		$this->assertContains( 'item-product', $result );
131
-		$this->assertContains( 'Cafe Noire Expresso', $result );
130
+		$this->assertContains('item-product', $result);
131
+		$this->assertContains('Cafe Noire Expresso', $result);
132 132
 	}
133 133
 
134 134
 
135 135
 	public function testGetException()
136 136
 	{
137
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
138
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
139
-			->setMethods( array( 'getSubClients' ) )
137
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
138
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
139
+			->setMethods(array('getSubClients'))
140 140
 			->getMock();
141 141
 
142
-		$object->expects( $this->once() )->method( 'getSubClients' )
143
-			->will( $this->throwException( new \RuntimeException() ) );
142
+		$object->expects($this->once())->method('getSubClients')
143
+			->will($this->throwException(new \RuntimeException()));
144 144
 
145
-		$object->setView( $this->getViewNoRender() );
145
+		$object->setView($this->getViewNoRender());
146 146
 
147 147
 		$object->get();
148 148
 	}
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
 
151 151
 	public function testGetMShopException()
152 152
 	{
153
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
154
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
155
-			->setMethods( array( 'getSubClients' ) )
153
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
154
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
155
+			->setMethods(array('getSubClients'))
156 156
 			->getMock();
157 157
 
158
-		$object->expects( $this->once() )->method( 'getSubClients' )
159
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
158
+		$object->expects($this->once())->method('getSubClients')
159
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
160 160
 
161
-		$object->setView( $this->getViewNoRender() );
161
+		$object->setView($this->getViewNoRender());
162 162
 
163 163
 		$object->get();
164 164
 	}
@@ -166,13 +166,13 @@  discard block
 block discarded – undo
166 166
 
167 167
 	public function testSave()
168 168
 	{
169
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
169
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
170 170
 
171
-		$item = $manager->findItem( 'cafe' );
172
-		$item->setCode( 'jqadm-test-save' );
173
-		$item->setId( null );
171
+		$item = $manager->findItem('cafe');
172
+		$item->setCode('jqadm-test-save');
173
+		$item->setId(null);
174 174
 
175
-		$item = $manager->insertItem( $item );
175
+		$item = $manager->insertItem($item);
176 176
 
177 177
 
178 178
 		$param = array(
@@ -188,83 +188,83 @@  discard block
 block discarded – undo
188 188
 			),
189 189
 		);
190 190
 
191
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
192
-		$this->view->addHelper( 'param', $helper );
191
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
192
+		$this->view->addHelper('param', $helper);
193 193
 		$this->view->item = $item;
194 194
 
195 195
 		$result = $this->object->save();
196 196
 
197
-		$item = $manager->getItem( $item->getId(), ['product'] );
198
-		$manager->deleteItem( $item->getId() );
197
+		$item = $manager->getItem($item->getId(), ['product']);
198
+		$manager->deleteItem($item->getId());
199 199
 
200
-		$this->assertNull( $this->view->get( 'errors' ) );
201
-		$this->assertNull( $result );
202
-		$this->assertEquals( 1, count( $item->getListItems() ) );
200
+		$this->assertNull($this->view->get('errors'));
201
+		$this->assertNull($result);
202
+		$this->assertEquals(1, count($item->getListItems()));
203 203
 
204
-		foreach( $item->getListItems( 'product' ) as $listItem )
204
+		foreach ($item->getListItems('product') as $listItem)
205 205
 		{
206
-			$this->assertEquals( $item->getId(), $listItem->getParentId() );
207
-			$this->assertEquals( 'promotion', $listItem->getType() );
208
-			$this->assertEquals( 'product', $listItem->getDomain() );
209
-			$this->assertEquals( '2000-01-01 00:00:00', $listItem->getDateStart() );
210
-			$this->assertEquals( '2100-01-01 00:00:00', $listItem->getDateEnd() );
211
-			$this->assertEquals( ['test' => 'value'], $listItem->getConfig() );
212
-			$this->assertEquals( 'test', $listItem->getRefId() );
213
-			$this->assertEquals( 1, $listItem->getStatus() );
206
+			$this->assertEquals($item->getId(), $listItem->getParentId());
207
+			$this->assertEquals('promotion', $listItem->getType());
208
+			$this->assertEquals('product', $listItem->getDomain());
209
+			$this->assertEquals('2000-01-01 00:00:00', $listItem->getDateStart());
210
+			$this->assertEquals('2100-01-01 00:00:00', $listItem->getDateEnd());
211
+			$this->assertEquals(['test' => 'value'], $listItem->getConfig());
212
+			$this->assertEquals('test', $listItem->getRefId());
213
+			$this->assertEquals(1, $listItem->getStatus());
214 214
 		}
215 215
 	}
216 216
 
217 217
 
218 218
 	public function testSaveException()
219 219
 	{
220
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
221
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
222
-			->setMethods( array( 'fromArray' ) )
220
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
221
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
222
+			->setMethods(array('fromArray'))
223 223
 			->getMock();
224 224
 
225
-		$object->expects( $this->once() )->method( 'fromArray' )
226
-			->will( $this->throwException( new \RuntimeException() ) );
225
+		$object->expects($this->once())->method('fromArray')
226
+			->will($this->throwException(new \RuntimeException()));
227 227
 
228
-		$object->setView( $this->getViewNoRender() );
228
+		$object->setView($this->getViewNoRender());
229 229
 
230
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
230
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
231 231
 		$object->save();
232 232
 	}
233 233
 
234 234
 
235 235
 	public function testSaveMShopException()
236 236
 	{
237
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Product\Standard::class )
238
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
239
-			->setMethods( array( 'fromArray' ) )
237
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Product\Standard::class)
238
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
239
+			->setMethods(array('fromArray'))
240 240
 			->getMock();
241 241
 
242
-		$object->expects( $this->once() )->method( 'fromArray' )
243
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
242
+		$object->expects($this->once())->method('fromArray')
243
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
244 244
 
245
-		$object->setView( $this->getViewNoRender() );
245
+		$object->setView($this->getViewNoRender());
246 246
 
247
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
247
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
248 248
 		$object->save();
249 249
 	}
250 250
 
251 251
 
252 252
 	public function testGetSubClient()
253 253
 	{
254
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
255
-		$this->object->getSubClient( 'unknown' );
254
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
255
+		$this->object->getSubClient('unknown');
256 256
 	}
257 257
 
258 258
 
259 259
 	protected function getViewNoRender()
260 260
 	{
261
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
262
-			->setConstructorArgs( array( [] ) )
263
-			->setMethods( array( 'render', 'config' ) )
261
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
262
+			->setConstructorArgs(array([]))
263
+			->setMethods(array('render', 'config'))
264 264
 			->getMock();
265 265
 
266
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
267
-		$view->item = $manager->findItem( 'cafe' );
266
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
267
+		$view->item = $manager->findItem('cafe');
268 268
 
269 269
 		return $view;
270 270
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Catalog/Text/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$langManager = \Aimeos\MShop::create( $this->context, 'locale/language' );
24
+		$langManager = \Aimeos\MShop::create($this->context, 'locale/language');
25 25
 
26
-		$this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() );
27
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'catalog' )->createItem();
26
+		$this->view->pageLanguages = $langManager->searchItems($langManager->createSearch());
27
+		$this->view->item = \Aimeos\MShop::create($this->context, 'catalog')->createItem();
28 28
 
29
-		$this->object = new \Aimeos\Admin\JQAdm\Catalog\Text\Standard( $this->context );
30
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
31
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
32
-		$this->object->setView( $this->view );
29
+		$this->object = new \Aimeos\Admin\JQAdm\Catalog\Text\Standard($this->context);
30
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
31
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
32
+		$this->object->setView($this->view);
33 33
 	}
34 34
 
35 35
 
36 36
 	protected function tearDown()
37 37
 	{
38
-		unset( $this->object, $this->view, $this->context );
38
+		unset($this->object, $this->view, $this->context);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testCreate()
43 43
 	{
44
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
44
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
45 45
 
46 46
 		$this->view->item = $manager->createItem();
47 47
 		$result = $this->object->create();
48 48
 
49
-		$this->assertNull( $this->view->get( 'errors' ) );
50
-		$this->assertContains( 'item-text', $result );
49
+		$this->assertNull($this->view->get('errors'));
50
+		$this->assertContains('item-text', $result);
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testCopy()
55 55
 	{
56
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
56
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
57 57
 
58
-		$this->view->item = $manager->findItem( 'cafe', array( 'text' ) );
58
+		$this->view->item = $manager->findItem('cafe', array('text'));
59 59
 		$result = $this->object->copy();
60 60
 
61
-		$this->assertNull( $this->view->get( 'errors' ) );
62
-		$this->assertContains( 'item-text', $result );
61
+		$this->assertNull($this->view->get('errors'));
62
+		$this->assertContains('item-text', $result);
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testDelete()
67 67
 	{
68
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
68
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
69 69
 
70 70
 		$this->view->item = $manager->createItem();
71 71
 		$result = $this->object->delete();
72 72
 
73
-		$this->assertNull( $this->view->get( 'errors' ) );
74
-		$this->assertNull( $result );
73
+		$this->assertNull($this->view->get('errors'));
74
+		$this->assertNull($result);
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGet()
79 79
 	{
80
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
80
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
81 81
 
82
-		$this->view->item = $manager->findItem( 'cafe', array( 'text' ) );
82
+		$this->view->item = $manager->findItem('cafe', array('text'));
83 83
 		$result = $this->object->get();
84 84
 
85
-		$this->assertNull( $this->view->get( 'errors' ) );
86
-		$this->assertContains( 'item-text', $result );
85
+		$this->assertNull($this->view->get('errors'));
86
+		$this->assertContains('item-text', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testSave()
91 91
 	{
92
-		$manager = \Aimeos\MShop::create( $this->context, 'catalog' );
92
+		$manager = \Aimeos\MShop::create($this->context, 'catalog');
93 93
 		$item = $manager->createItem();
94 94
 
95 95
 		$param = array(
@@ -119,75 +119,75 @@  discard block
 block discarded – undo
119 119
 			),
120 120
 		);
121 121
 
122
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
123
-		$this->view->addHelper( 'param', $helper );
122
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
123
+		$this->view->addHelper('param', $helper);
124 124
 		$this->view->item = $item;
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128
-		$this->assertNull( $this->view->get( 'errors' ) );
129
-		$this->assertNull( $result );
130
-		$this->assertEquals( 3, count( $this->view->item->getListItems() ) );
128
+		$this->assertNull($this->view->get('errors'));
129
+		$this->assertNull($result);
130
+		$this->assertEquals(3, count($this->view->item->getListItems()));
131 131
 
132
-		foreach( $this->view->item->getListItems( 'text' ) as $listItem )
132
+		foreach ($this->view->item->getListItems('text') as $listItem)
133 133
 		{
134
-			$this->assertEquals( 'text', $listItem->getDomain() );
134
+			$this->assertEquals('text', $listItem->getDomain());
135 135
 
136 136
 			$refItem = $listItem->getRefItem();
137
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
137
+			$this->assertEquals('de', $refItem->getLanguageId());
138 138
 		}
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testSaveException()
143 143
 	{
144
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Text\Standard::class )
145
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
146
-			->setMethods( array( 'fromArray' ) )
144
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Text\Standard::class)
145
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
146
+			->setMethods(array('fromArray'))
147 147
 			->getMock();
148 148
 
149
-		$object->expects( $this->once() )->method( 'fromArray' )
150
-			->will( $this->throwException( new \RuntimeException() ) );
149
+		$object->expects($this->once())->method('fromArray')
150
+			->will($this->throwException(new \RuntimeException()));
151 151
 
152 152
 		$this->view = \TestHelperJqadm::getView();
153
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'catalog' )->createItem();
153
+		$this->view->item = \Aimeos\MShop::create($this->context, 'catalog')->createItem();
154 154
 
155
-		$object->setView( $this->view );
155
+		$object->setView($this->view);
156 156
 
157
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
157
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
158 158
 		$object->save();
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testSaveMShopException()
163 163
 	{
164
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Catalog\Text\Standard::class )
165
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
166
-			->setMethods( array( 'fromArray' ) )
164
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Catalog\Text\Standard::class)
165
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
166
+			->setMethods(array('fromArray'))
167 167
 			->getMock();
168 168
 
169
-		$object->expects( $this->once() )->method( 'fromArray' )
170
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
169
+		$object->expects($this->once())->method('fromArray')
170
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
171 171
 
172 172
 		$this->view = \TestHelperJqadm::getView();
173
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'catalog' )->createItem();
173
+		$this->view->item = \Aimeos\MShop::create($this->context, 'catalog')->createItem();
174 174
 
175
-		$object->setView( $this->view );
175
+		$object->setView($this->view);
176 176
 
177
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
177
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class );
191
-		$this->object->getSubClient( 'unknown' );
190
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
191
+		$this->object->getSubClient('unknown');
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Service/Text/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$langManager = \Aimeos\MShop::create( $this->context, 'locale/language' );
24
+		$langManager = \Aimeos\MShop::create($this->context, 'locale/language');
25 25
 
26
-		$this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() );
27
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
26
+		$this->view->pageLanguages = $langManager->searchItems($langManager->createSearch());
27
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
28 28
 
29
-		$this->object = new \Aimeos\Admin\JQAdm\Service\Text\Standard( $this->context );
30
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
31
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
32
-		$this->object->setView( $this->view );
29
+		$this->object = new \Aimeos\Admin\JQAdm\Service\Text\Standard($this->context);
30
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
31
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
32
+		$this->object->setView($this->view);
33 33
 	}
34 34
 
35 35
 
36 36
 	protected function tearDown()
37 37
 	{
38
-		unset( $this->object, $this->view, $this->context );
38
+		unset($this->object, $this->view, $this->context);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testCreate()
43 43
 	{
44
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
44
+		$manager = \Aimeos\MShop::create($this->context, 'service');
45 45
 
46 46
 		$this->view->item = $manager->createItem();
47 47
 		$result = $this->object->create();
48 48
 
49
-		$this->assertContains( 'item-text', $result );
50
-		$this->assertNull( $this->view->get( 'errors' ) );
49
+		$this->assertContains('item-text', $result);
50
+		$this->assertNull($this->view->get('errors'));
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testCopy()
55 55
 	{
56
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
56
+		$manager = \Aimeos\MShop::create($this->context, 'service');
57 57
 
58
-		$this->view->item = $manager->findItem( 'unitcode', ['text'] );
58
+		$this->view->item = $manager->findItem('unitcode', ['text']);
59 59
 		$result = $this->object->copy();
60 60
 
61
-		$this->assertNull( $this->view->get( 'errors' ) );
62
-		$this->assertContains( 'Unittest service name', $result );
61
+		$this->assertNull($this->view->get('errors'));
62
+		$this->assertContains('Unittest service name', $result);
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testDelete()
67 67
 	{
68
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
68
+		$manager = \Aimeos\MShop::create($this->context, 'service');
69 69
 
70 70
 		$this->view->item = $manager->createItem();
71 71
 		$result = $this->object->delete();
72 72
 
73
-		$this->assertNull( $this->view->get( 'errors' ) );
74
-		$this->assertNull( $result );
73
+		$this->assertNull($this->view->get('errors'));
74
+		$this->assertNull($result);
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGet()
79 79
 	{
80
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
80
+		$manager = \Aimeos\MShop::create($this->context, 'service');
81 81
 
82
-		$this->view->item = $manager->findItem( 'unitcode', ['text'] );
82
+		$this->view->item = $manager->findItem('unitcode', ['text']);
83 83
 		$result = $this->object->get();
84 84
 
85
-		$this->assertNull( $this->view->get( 'errors' ) );
86
-		$this->assertContains( 'Unittest service name', $result );
85
+		$this->assertNull($this->view->get('errors'));
86
+		$this->assertContains('Unittest service name', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testSave()
91 91
 	{
92
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
92
+		$manager = \Aimeos\MShop::create($this->context, 'service');
93 93
 		$item = $manager->createItem();
94 94
 
95 95
 		$param = array(
@@ -119,75 +119,75 @@  discard block
 block discarded – undo
119 119
 			),
120 120
 		);
121 121
 
122
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
123
-		$this->view->addHelper( 'param', $helper );
122
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
123
+		$this->view->addHelper('param', $helper);
124 124
 		$this->view->item = $item;
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128
-		$this->assertNull( $this->view->get( 'errors' ) );
129
-		$this->assertNull( $result );
130
-		$this->assertEquals( 3, count( $item->getListItems() ) );
128
+		$this->assertNull($this->view->get('errors'));
129
+		$this->assertNull($result);
130
+		$this->assertEquals(3, count($item->getListItems()));
131 131
 
132
-		foreach( $item->getListItems( 'text' ) as $listItem )
132
+		foreach ($item->getListItems('text') as $listItem)
133 133
 		{
134
-			$this->assertEquals( 'text', $listItem->getDomain() );
134
+			$this->assertEquals('text', $listItem->getDomain());
135 135
 
136 136
 			$refItem = $listItem->getRefItem();
137
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
137
+			$this->assertEquals('de', $refItem->getLanguageId());
138 138
 		}
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testSaveException()
143 143
 	{
144
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Text\Standard::class )
145
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
146
-			->setMethods( array( 'fromArray' ) )
144
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\Text\Standard::class)
145
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
146
+			->setMethods(array('fromArray'))
147 147
 			->getMock();
148 148
 
149
-		$object->expects( $this->once() )->method( 'fromArray' )
150
-			->will( $this->throwException( new \RuntimeException() ) );
149
+		$object->expects($this->once())->method('fromArray')
150
+			->will($this->throwException(new \RuntimeException()));
151 151
 
152 152
 		$this->view = \TestHelperJqadm::getView();
153
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
153
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
154 154
 
155
-		$object->setView( $this->view );
155
+		$object->setView($this->view);
156 156
 
157
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
157
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
158 158
 		$object->save();
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testSaveMShopException()
163 163
 	{
164
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Text\Standard::class )
165
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
166
-			->setMethods( array( 'fromArray' ) )
164
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\Text\Standard::class)
165
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
166
+			->setMethods(array('fromArray'))
167 167
 			->getMock();
168 168
 
169
-		$object->expects( $this->once() )->method( 'fromArray' )
170
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
169
+		$object->expects($this->once())->method('fromArray')
170
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
171 171
 
172 172
 		$this->view = \TestHelperJqadm::getView();
173
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
173
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
174 174
 
175
-		$object->setView( $this->view );
175
+		$object->setView($this->view);
176 176
 
177
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
177
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class );
191
-		$this->object->getSubClient( 'unknown' );
190
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
191
+		$this->object->getSubClient('unknown');
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Service/Price/StandardTest.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -21,70 +21,70 @@  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\Service\Price\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\Service\Price\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
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'service');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-price', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-price', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'service');
52 52
 
53
-		$this->view->item = $manager->findItem( 'unitcode', ['price'] );
53
+		$this->view->item = $manager->findItem('unitcode', ['price']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '&quot;price.type&quot;:&quot;default&quot;', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('&quot;price.type&quot;:&quot;default&quot;', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'service');
64 64
 
65 65
 		$this->view->item = $manager->createItem();
66 66
 		$result = $this->object->delete();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertNull( $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertNull($result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGet()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'service');
76 76
 
77
-		$this->view->item = $manager->findItem( 'unitcode', ['price'] );
77
+		$this->view->item = $manager->findItem('unitcode', ['price']);
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '&quot;price.type&quot;:&quot;default&quot;', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('&quot;price.type&quot;:&quot;default&quot;', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'service');
88 88
 		$item = $manager->createItem();
89 89
 
90 90
 		$param = array(
@@ -102,80 +102,80 @@  discard block
 block discarded – undo
102 102
 			]],
103 103
 		);
104 104
 
105
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
106
-		$this->view->addHelper( 'param', $helper );
105
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
106
+		$this->view->addHelper('param', $helper);
107 107
 		$this->view->item = $item;
108 108
 
109 109
 		$result = $this->object->save();
110 110
 
111
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
113
-		$this->assertEquals( 1, count( $item->getListItems() ) );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113
+		$this->assertEquals(1, count($item->getListItems()));
114 114
 
115
-		foreach( $item->getListItems( 'price' ) as $listItem )
115
+		foreach ($item->getListItems('price') as $listItem)
116 116
 		{
117
-			$this->assertEquals( 'price', $listItem->getDomain() );
117
+			$this->assertEquals('price', $listItem->getDomain());
118 118
 
119 119
 			$refItem = $listItem->getRefItem();
120
-			$this->assertEquals( 'EUR', $refItem->getCurrencyId() );
121
-			$this->assertEquals( '20.00', $refItem->getTaxRate() );
122
-			$this->assertEquals( '10.00', $refItem->getValue() );
123
-			$this->assertEquals( '5.00', $refItem->getRebate() );
124
-			$this->assertEquals( '1.00', $refItem->getCosts() );
125
-			$this->assertEquals( '2', $refItem->getQuantity() );
120
+			$this->assertEquals('EUR', $refItem->getCurrencyId());
121
+			$this->assertEquals('20.00', $refItem->getTaxRate());
122
+			$this->assertEquals('10.00', $refItem->getValue());
123
+			$this->assertEquals('5.00', $refItem->getRebate());
124
+			$this->assertEquals('1.00', $refItem->getCosts());
125
+			$this->assertEquals('2', $refItem->getQuantity());
126 126
 		}
127 127
 	}
128 128
 
129 129
 
130 130
 	public function testSaveException()
131 131
 	{
132
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Price\Standard::class )
133
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
134
-			->setMethods( array( 'fromArray' ) )
132
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\Price\Standard::class)
133
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
134
+			->setMethods(array('fromArray'))
135 135
 			->getMock();
136 136
 
137
-		$object->expects( $this->once() )->method( 'fromArray' )
138
-			->will( $this->throwException( new \RuntimeException() ) );
137
+		$object->expects($this->once())->method('fromArray')
138
+			->will($this->throwException(new \RuntimeException()));
139 139
 
140 140
 		$view = \TestHelperJqadm::getView();
141
-		$view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
141
+		$view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
142 142
 
143
-		$object->setView( $view );
143
+		$object->setView($view);
144 144
 
145
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
145
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
146 146
 		$object->save();
147 147
 	}
148 148
 
149 149
 
150 150
 	public function testSaveMShopException()
151 151
 	{
152
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Price\Standard::class )
153
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
154
-			->setMethods( array( 'fromArray' ) )
152
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\Price\Standard::class)
153
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
154
+			->setMethods(array('fromArray'))
155 155
 			->getMock();
156 156
 
157
-		$object->expects( $this->once() )->method( 'fromArray' )
158
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
157
+		$object->expects($this->once())->method('fromArray')
158
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
159 159
 
160 160
 		$this->view = \TestHelperJqadm::getView();
161
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'service' )->createItem();
161
+		$this->view->item = \Aimeos\MShop::create($this->context, 'service')->createItem();
162 162
 
163
-		$object->setView( $this->view );
163
+		$object->setView($this->view);
164 164
 
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166 166
 		$object->save();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSearch()
171 171
 	{
172
-		$this->assertNull( $this->object->search() );
172
+		$this->assertNull($this->object->search());
173 173
 	}
174 174
 
175 175
 
176 176
 	public function testGetSubClient()
177 177
 	{
178
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
179
-		$this->object->getSubClient( 'unknown' );
178
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
179
+		$this->object->getSubClient('unknown');
180 180
 	}
181 181
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Customer/Address/StandardTest.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  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\Customer\Address\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\Customer\Address\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
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-address', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-address', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
52 52
 
53
-		$this->view->item = $manager->findItem( 'UTC001', array( 'customer/address' ) );
53
+		$this->view->item = $manager->findItem('UTC001', array('customer/address'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Example company', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Example company', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,26 +62,26 @@  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::create( $this->context, 'customer' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
73 73
 
74
-		$this->view->item = $manager->findItem( 'UTC001', array( 'customer/address' ) );
74
+		$this->view->item = $manager->findItem('UTC001', array('customer/address'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Example company', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Example company', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
@@ -96,73 +96,73 @@  discard block
 block discarded – undo
96 96
 			),
97 97
 		);
98 98
 
99
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
100
-		$this->view->addHelper( 'param', $helper );
99
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
100
+		$this->view->addHelper('param', $helper);
101 101
 
102 102
 		$result = $this->object->save();
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $this->view->item->getAddressItems() ) );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($this->view->item->getAddressItems()));
107 107
 
108
-		foreach( $this->view->item->getAddressItems() as $addrItem )
108
+		foreach ($this->view->item->getAddressItems() as $addrItem)
109 109
 		{
110
-			$this->assertEquals( '[email protected]', $addrItem->getEmail() );
111
-			$this->assertEquals( 'test', $addrItem->getFirstname() );
112
-			$this->assertEquals( 'user', $addrItem->getLastname() );
110
+			$this->assertEquals('[email protected]', $addrItem->getEmail());
111
+			$this->assertEquals('test', $addrItem->getFirstname());
112
+			$this->assertEquals('user', $addrItem->getLastname());
113 113
 		}
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testSaveException()
118 118
 	{
119
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Address\Standard::class )
120
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
121
-			->setMethods( array( 'fromArray' ) )
119
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Address\Standard::class)
120
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
121
+			->setMethods(array('fromArray'))
122 122
 			->getMock();
123 123
 
124
-		$object->expects( $this->once() )->method( 'fromArray' )
125
-			->will( $this->throwException( new \RuntimeException() ) );
124
+		$object->expects($this->once())->method('fromArray')
125
+			->will($this->throwException(new \RuntimeException()));
126 126
 
127 127
 		$view = \TestHelperJqadm::getView();
128
-		$view->item = \Aimeos\MShop::create( $this->context, 'customer' )->createItem();
128
+		$view->item = \Aimeos\MShop::create($this->context, 'customer')->createItem();
129 129
 
130
-		$object->setView( $view );
130
+		$object->setView($view);
131 131
 
132
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
132
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
133 133
 		$object->save();
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testSaveMShopException()
138 138
 	{
139
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Address\Standard::class )
140
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
141
-			->setMethods( array( 'fromArray' ) )
139
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Address\Standard::class)
140
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
141
+			->setMethods(array('fromArray'))
142 142
 			->getMock();
143 143
 
144
-		$object->expects( $this->once() )->method( 'fromArray' )
145
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
144
+		$object->expects($this->once())->method('fromArray')
145
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
146 146
 
147 147
 		$this->view = \TestHelperJqadm::getView();
148
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'customer' )->createItem();
148
+		$this->view->item = \Aimeos\MShop::create($this->context, 'customer')->createItem();
149 149
 
150
-		$object->setView( $this->view );
150
+		$object->setView($this->view);
151 151
 
152
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
152
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
153 153
 		$object->save();
154 154
 	}
155 155
 
156 156
 
157 157
 	public function testSearch()
158 158
 	{
159
-		$this->assertNull( $this->object->search() );
159
+		$this->assertNull($this->object->search());
160 160
 	}
161 161
 
162 162
 
163 163
 	public function testGetSubClient()
164 164
 	{
165
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
166
-		$this->object->getSubClient( 'unknown' );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166
+		$this->object->getSubClient('unknown');
167 167
 	}
168 168
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Customer/Order/StandardTest.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -21,66 +21,66 @@  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\Customer\Order\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\Customer\Order\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
 
37 37
 	public function testCopy()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
40
-		$this->view->item = $manager->findItem( 'UTC001' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
40
+		$this->view->item = $manager->findItem('UTC001');
41 41
 
42 42
 		$result = $this->object->copy();
43 43
 
44
-		$this->assertContains( 'item-order', $result );
45
-		$this->assertContains( '4800.00', $result );
44
+		$this->assertContains('item-order', $result);
45
+		$this->assertContains('4800.00', $result);
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCreate()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
52
-		$this->view->item = $manager->findItem( 'UTC001' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
52
+		$this->view->item = $manager->findItem('UTC001');
53 53
 
54 54
 		$result = $this->object->create();
55 55
 
56
-		$this->assertContains( 'item-order', $result );
57
-		$this->assertContains( '4800.00', $result );
56
+		$this->assertContains('item-order', $result);
57
+		$this->assertContains('4800.00', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testGet()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
64
-		$this->view->item = $manager->findItem( 'UTC001' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
64
+		$this->view->item = $manager->findItem('UTC001');
65 65
 
66 66
 		$result = $this->object->get();
67 67
 
68
-		$this->assertContains( 'item-order', $result );
69
-		$this->assertContains( '4800.00', $result );
68
+		$this->assertContains('item-order', $result);
69
+		$this->assertContains('4800.00', $result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGetException()
74 74
 	{
75
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Order\Standard::class )
76
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
77
-			->setMethods( array( 'storeSearchParams' ) )
75
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Order\Standard::class)
76
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
77
+			->setMethods(array('storeSearchParams'))
78 78
 			->getMock();
79 79
 
80
-		$object->expects( $this->once() )->method( 'storeSearchParams' )
81
-			->will( $this->throwException( new \RuntimeException() ) );
80
+		$object->expects($this->once())->method('storeSearchParams')
81
+			->will($this->throwException(new \RuntimeException()));
82 82
 
83
-		$object->setView( $this->getViewNoRender() );
83
+		$object->setView($this->getViewNoRender());
84 84
 
85 85
 		$object->get();
86 86
 	}
@@ -88,15 +88,15 @@  discard block
 block discarded – undo
88 88
 
89 89
 	public function testGetMShopException()
90 90
 	{
91
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Customer\Order\Standard::class )
92
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
93
-			->setMethods( array( 'storeSearchParams' ) )
91
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Customer\Order\Standard::class)
92
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
93
+			->setMethods(array('storeSearchParams'))
94 94
 			->getMock();
95 95
 
96
-		$object->expects( $this->once() )->method( 'storeSearchParams' )
97
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
96
+		$object->expects($this->once())->method('storeSearchParams')
97
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
98 98
 
99
-		$object->setView( $this->getViewNoRender() );
99
+		$object->setView($this->getViewNoRender());
100 100
 
101 101
 		$object->get();
102 102
 	}
@@ -104,28 +104,28 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testSave()
106 106
 	{
107
-		$manager = \Aimeos\MShop::create( $this->context, 'customer' );
108
-		$this->view->item = $manager->findItem( 'UTC001' );
107
+		$manager = \Aimeos\MShop::create($this->context, 'customer');
108
+		$this->view->item = $manager->findItem('UTC001');
109 109
 
110 110
 		$result = $this->object->save();
111 111
 
112
-		$this->assertContains( 'item-order', $result );
113
-		$this->assertContains( '4800.00', $result );
112
+		$this->assertContains('item-order', $result);
113
+		$this->assertContains('4800.00', $result);
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 
123 123
 
124 124
 	protected function getViewNoRender()
125 125
 	{
126
-		return $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
127
-			->setConstructorArgs( array( [] ) )
128
-			->setMethods( array( 'render', 'config' ) )
126
+		return $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
127
+			->setConstructorArgs(array([]))
128
+			->setMethods(array('render', 'config'))
129 129
 			->getMock();
130 130
 	}
131 131
 }
Please login to merge, or discard this patch.