Completed
Push — master ( 06a6c1...f03436 )
by Aimeos
03:56
created
admin/jqadm/tests/Admin/JQAdm/Locale/Currency/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -280,6 +280,9 @@
 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\Currency\Standard' )
Please login to merge, or discard this patch.
Spacing   +83 added lines, -83 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\Currency\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\Currency\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,21 +64,21 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function testCopy()
66 66
 	{
67
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'EUR'] );
68
-		$this->view->addHelper( 'param', $helper );
67
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'EUR']);
68
+		$this->view->addHelper('param', $helper);
69 69
 
70 70
 		$result = $this->object->copy();
71 71
 
72
-		$this->assertContains( 'Euro', $result );
72
+		$this->assertContains('Euro', $result);
73 73
 	}
74 74
 
75 75
 
76 76
 	public function testCopyException()
77 77
 	{
78
-		$object = $this->getClientMock( 'getSubClients' );
78
+		$object = $this->getClientMock('getSubClients');
79 79
 
80
-		$object->expects( $this->once() )->method( 'getSubClients' )
81
-			->will( $this->throwException( new \RuntimeException() ) );
80
+		$object->expects($this->once())->method('getSubClients')
81
+			->will($this->throwException(new \RuntimeException()));
82 82
 
83 83
 		$object->copy();
84 84
 	}
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function testCopyMShopException()
88 88
 	{
89
-		$object = $this->getClientMock( 'getSubClients' );
89
+		$object = $this->getClientMock('getSubClients');
90 90
 
91
-		$object->expects( $this->once() )->method( 'getSubClients' )
92
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
91
+		$object->expects($this->once())->method('getSubClients')
92
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
93 93
 
94 94
 		$object->copy();
95 95
 	}
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 
98 98
 	public function testDelete()
99 99
 	{
100
-		$this->assertNotNull( $this->object->delete() );
100
+		$this->assertNotNull($this->object->delete());
101 101
 	}
102 102
 
103 103
 
104 104
 	public function testDeleteException()
105 105
 	{
106
-		$object = $this->getClientMock( 'getSubClients' );
106
+		$object = $this->getClientMock('getSubClients');
107 107
 
108
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
109
-			->will( $this->throwException( new \RuntimeException() ) );
108
+		$object->expects($this->exactly(2))->method('getSubClients')
109
+			->will($this->throwException(new \RuntimeException()));
110 110
 
111 111
 		$object->delete();
112 112
 	}
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
 	public function testDeleteMShopException()
116 116
 	{
117
-		$object = $this->getClientMock( 'getSubClients' );
117
+		$object = $this->getClientMock('getSubClients');
118 118
 
119
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
120
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
119
+		$object->expects($this->exactly(2))->method('getSubClients')
120
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
121 121
 
122 122
 		$object->delete();
123 123
 	}
@@ -125,21 +125,21 @@  discard block
 block discarded – undo
125 125
 
126 126
 	public function testGet()
127 127
 	{
128
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'EUR'] );
129
-		$this->view->addHelper( 'param', $helper );
128
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'EUR']);
129
+		$this->view->addHelper('param', $helper);
130 130
 
131 131
 		$result = $this->object->get();
132 132
 
133
-		$this->assertContains( 'EUR', $result );
133
+		$this->assertContains('EUR', $result);
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testGetException()
138 138
 	{
139
-		$object = $this->getClientMock( 'getSubClients' );
139
+		$object = $this->getClientMock('getSubClients');
140 140
 
141
-		$object->expects( $this->once() )->method( 'getSubClients' )
142
-			->will( $this->throwException( new \RuntimeException() ) );
141
+		$object->expects($this->once())->method('getSubClients')
142
+			->will($this->throwException(new \RuntimeException()));
143 143
 
144 144
 		$object->get();
145 145
 	}
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 
148 148
 	public function testGetMShopException()
149 149
 	{
150
-		$object = $this->getClientMock( 'getSubClients' );
150
+		$object = $this->getClientMock('getSubClients');
151 151
 
152
-		$object->expects( $this->once() )->method( 'getSubClients' )
153
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
152
+		$object->expects($this->once())->method('getSubClients')
153
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
154 154
 
155 155
 		$object->get();
156 156
 	}
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGetViewException()
160 160
 	{
161
-		$object = new \Aimeos\Admin\JQAdm\Locale\Currency\Standard( $this->context, [] );
161
+		$object = new \Aimeos\Admin\JQAdm\Locale\Currency\Standard($this->context, []);
162 162
 
163
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
163
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
164 164
 		$object->getView();
165 165
 	}
166 166
 
167 167
 
168 168
 	public function testSave()
169 169
 	{
170
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale/currency' );
170
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'locale/currency');
171 171
 
172 172
 		$param = array(
173 173
 			'item' => array(
@@ -178,24 +178,24 @@  discard block
 block discarded – undo
178 178
 			),
179 179
 		);
180 180
 
181
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
182
-		$this->view->addHelper( 'param', $helper );
181
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
182
+		$this->view->addHelper('param', $helper);
183 183
 
184 184
 		$this->object->save();
185 185
 
186
-		$item = $manager->findItem( 'XXX' );
187
-		$manager->deleteItem( $item->getId() );
186
+		$item = $manager->findItem('XXX');
187
+		$manager->deleteItem($item->getId());
188 188
 
189
-		$this->assertEquals( 'jqadm test', $item->getLabel() );
189
+		$this->assertEquals('jqadm test', $item->getLabel());
190 190
 	}
191 191
 
192 192
 
193 193
 	public function testSaveException()
194 194
 	{
195
-		$object = $this->getClientMock( 'fromArray' );
195
+		$object = $this->getClientMock('fromArray');
196 196
 
197
-		$object->expects( $this->once() )->method( 'fromArray' )
198
-			->will( $this->throwException( new \RuntimeException() ) );
197
+		$object->expects($this->once())->method('fromArray')
198
+			->will($this->throwException(new \RuntimeException()));
199 199
 
200 200
 		$object->save();
201 201
 	}
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 
204 204
 	public function testSaveMShopException()
205 205
 	{
206
-		$object = $this->getClientMock( 'fromArray' );
206
+		$object = $this->getClientMock('fromArray');
207 207
 
208
-		$object->expects( $this->once() )->method( 'fromArray' )
209
-			->will( $this->throwException( new \RuntimeException() ) );
208
+		$object->expects($this->once())->method('fromArray')
209
+			->will($this->throwException(new \RuntimeException()));
210 210
 
211 211
 		$object->save();
212 212
 	}
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
 	public function testSaveJQAdmException()
216 216
 	{
217
-		$object = $this->getClientMock( 'fromArray' );
217
+		$object = $this->getClientMock('fromArray');
218 218
 
219
-		$object->expects( $this->once() )->method( 'fromArray' )
220
-			->will( $this->throwException( new \RuntimeException() ) );
219
+		$object->expects($this->once())->method('fromArray')
220
+			->will($this->throwException(new \RuntimeException()));
221 221
 
222 222
 		$object->save();
223 223
 	}
@@ -228,27 +228,27 @@  discard block
 block discarded – undo
228 228
 		$param = array(
229 229
 			'lang' => 'de',
230 230
 			'filter' => array(
231
-				'key' => array( 0 => 'locale.currency.code' ),
232
-				'op' => array( 0 => '==' ),
233
-				'val' => array( 0 => 'EUR' ),
231
+				'key' => array(0 => 'locale.currency.code'),
232
+				'op' => array(0 => '=='),
233
+				'val' => array(0 => 'EUR'),
234 234
 			),
235
-			'sort' => array( '-locale.currency.id' ),
235
+			'sort' => array('-locale.currency.id'),
236 236
 		);
237
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
238
-		$this->view->addHelper( 'param', $helper );
237
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
238
+		$this->view->addHelper('param', $helper);
239 239
 
240 240
 		$result = $this->object->search();
241 241
 
242
-		$this->assertContains( '>EUR<', $result );
242
+		$this->assertContains('>EUR<', $result);
243 243
 	}
244 244
 
245 245
 
246 246
 	public function testSearchException()
247 247
 	{
248
-		$object = $this->getClientMock( 'initCriteria' );
248
+		$object = $this->getClientMock('initCriteria');
249 249
 
250
-		$object->expects( $this->once() )->method( 'initCriteria' )
251
-			->will( $this->throwException( new \RuntimeException() ) );
250
+		$object->expects($this->once())->method('initCriteria')
251
+			->will($this->throwException(new \RuntimeException()));
252 252
 
253 253
 		$object->search();
254 254
 	}
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 
257 257
 	public function testSearchMShopException()
258 258
 	{
259
-		$object = $this->getClientMock( 'initCriteria' );
259
+		$object = $this->getClientMock('initCriteria');
260 260
 
261
-		$object->expects( $this->once() )->method( 'initCriteria' )
262
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
261
+		$object->expects($this->once())->method('initCriteria')
262
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
263 263
 
264 264
 		$object->search();
265 265
 	}
@@ -267,27 +267,27 @@  discard block
 block discarded – undo
267 267
 
268 268
 	public function testGetSubClientInvalid()
269 269
 	{
270
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
271
-		$this->object->getSubClient( '$unknown$' );
270
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
271
+		$this->object->getSubClient('$unknown$');
272 272
 	}
273 273
 
274 274
 
275 275
 	public function testGetSubClientUnknown()
276 276
 	{
277
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
278
-		$this->object->getSubClient( 'unknown' );
277
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
278
+		$this->object->getSubClient('unknown');
279 279
 	}
280 280
 
281 281
 
282
-	public function getClientMock( $method )
282
+	public function getClientMock($method)
283 283
 	{
284
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Locale\Currency\Standard' )
285
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
286
-			->setMethods( [$method] )
284
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Locale\Currency\Standard')
285
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
286
+			->setMethods([$method])
287 287
 			->getMock();
288 288
 
289
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
290
-		$object->setView( $this->getViewNoRender() );
289
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
290
+		$object->setView($this->getViewNoRender());
291 291
 
292 292
 		return $object;
293 293
 	}
@@ -295,16 +295,16 @@  discard block
 block discarded – undo
295 295
 
296 296
 	protected function getViewNoRender()
297 297
 	{
298
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
299
-			->setConstructorArgs( array( [] ) )
300
-			->setMethods( array( 'render', 'config' ) )
298
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
299
+			->setConstructorArgs(array([]))
300
+			->setMethods(array('render', 'config'))
301 301
 			->getMock();
302 302
 
303
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'EUR'] );
304
-		$view->addHelper( 'param', $helper );
303
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'EUR']);
304
+		$view->addHelper('param', $helper);
305 305
 
306
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
307
-		$view->addHelper( 'access', $helper );
306
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
307
+		$view->addHelper('access', $helper);
308 308
 
309 309
 		return $view;
310 310
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Locale/Language/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -280,6 +280,9 @@
 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\Language\Standard' )
Please login to merge, or discard this patch.
Spacing   +83 added lines, -83 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\Language\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\Language\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,21 +64,21 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function testCopy()
66 66
 	{
67
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'de'] );
68
-		$this->view->addHelper( 'param', $helper );
67
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'de']);
68
+		$this->view->addHelper('param', $helper);
69 69
 
70 70
 		$result = $this->object->copy();
71 71
 
72
-		$this->assertContains( 'German', $result );
72
+		$this->assertContains('German', $result);
73 73
 	}
74 74
 
75 75
 
76 76
 	public function testCopyException()
77 77
 	{
78
-		$object = $this->getClientMock( 'getSubClients' );
78
+		$object = $this->getClientMock('getSubClients');
79 79
 
80
-		$object->expects( $this->once() )->method( 'getSubClients' )
81
-			->will( $this->throwException( new \RuntimeException() ) );
80
+		$object->expects($this->once())->method('getSubClients')
81
+			->will($this->throwException(new \RuntimeException()));
82 82
 
83 83
 		$object->copy();
84 84
 	}
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
 
87 87
 	public function testCopyMShopException()
88 88
 	{
89
-		$object = $this->getClientMock( 'getSubClients' );
89
+		$object = $this->getClientMock('getSubClients');
90 90
 
91
-		$object->expects( $this->once() )->method( 'getSubClients' )
92
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
91
+		$object->expects($this->once())->method('getSubClients')
92
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
93 93
 
94 94
 		$object->copy();
95 95
 	}
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 
98 98
 	public function testDelete()
99 99
 	{
100
-		$this->assertNotNull( $this->object->delete() );
100
+		$this->assertNotNull($this->object->delete());
101 101
 	}
102 102
 
103 103
 
104 104
 	public function testDeleteException()
105 105
 	{
106
-		$object = $this->getClientMock( 'getSubClients' );
106
+		$object = $this->getClientMock('getSubClients');
107 107
 
108
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
109
-			->will( $this->throwException( new \RuntimeException() ) );
108
+		$object->expects($this->exactly(2))->method('getSubClients')
109
+			->will($this->throwException(new \RuntimeException()));
110 110
 
111 111
 		$object->delete();
112 112
 	}
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 
115 115
 	public function testDeleteMShopException()
116 116
 	{
117
-		$object = $this->getClientMock( 'getSubClients' );
117
+		$object = $this->getClientMock('getSubClients');
118 118
 
119
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
120
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
119
+		$object->expects($this->exactly(2))->method('getSubClients')
120
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
121 121
 
122 122
 		$object->delete();
123 123
 	}
@@ -125,21 +125,21 @@  discard block
 block discarded – undo
125 125
 
126 126
 	public function testGet()
127 127
 	{
128
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'de'] );
129
-		$this->view->addHelper( 'param', $helper );
128
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'de']);
129
+		$this->view->addHelper('param', $helper);
130 130
 
131 131
 		$result = $this->object->get();
132 132
 
133
-		$this->assertContains( 'de', $result );
133
+		$this->assertContains('de', $result);
134 134
 	}
135 135
 
136 136
 
137 137
 	public function testGetException()
138 138
 	{
139
-		$object = $this->getClientMock( 'getSubClients' );
139
+		$object = $this->getClientMock('getSubClients');
140 140
 
141
-		$object->expects( $this->once() )->method( 'getSubClients' )
142
-			->will( $this->throwException( new \RuntimeException() ) );
141
+		$object->expects($this->once())->method('getSubClients')
142
+			->will($this->throwException(new \RuntimeException()));
143 143
 
144 144
 		$object->get();
145 145
 	}
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
 
148 148
 	public function testGetMShopException()
149 149
 	{
150
-		$object = $this->getClientMock( 'getSubClients' );
150
+		$object = $this->getClientMock('getSubClients');
151 151
 
152
-		$object->expects( $this->once() )->method( 'getSubClients' )
153
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
152
+		$object->expects($this->once())->method('getSubClients')
153
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
154 154
 
155 155
 		$object->get();
156 156
 	}
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 
159 159
 	public function testGetViewException()
160 160
 	{
161
-		$object = new \Aimeos\Admin\JQAdm\Locale\Language\Standard( $this->context, [] );
161
+		$object = new \Aimeos\Admin\JQAdm\Locale\Language\Standard($this->context, []);
162 162
 
163
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
163
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
164 164
 		$object->getView();
165 165
 	}
166 166
 
167 167
 
168 168
 	public function testSave()
169 169
 	{
170
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale/language' );
170
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'locale/language');
171 171
 
172 172
 		$param = array(
173 173
 			'item' => array(
@@ -178,24 +178,24 @@  discard block
 block discarded – undo
178 178
 			),
179 179
 		);
180 180
 
181
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
182
-		$this->view->addHelper( 'param', $helper );
181
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
182
+		$this->view->addHelper('param', $helper);
183 183
 
184 184
 		$this->object->save();
185 185
 
186
-		$item = $manager->findItem( 'xx' );
187
-		$manager->deleteItem( $item->getId() );
186
+		$item = $manager->findItem('xx');
187
+		$manager->deleteItem($item->getId());
188 188
 
189
-		$this->assertEquals( 'jqadm test', $item->getLabel() );
189
+		$this->assertEquals('jqadm test', $item->getLabel());
190 190
 	}
191 191
 
192 192
 
193 193
 	public function testSaveException()
194 194
 	{
195
-		$object = $this->getClientMock( 'fromArray' );
195
+		$object = $this->getClientMock('fromArray');
196 196
 
197
-		$object->expects( $this->once() )->method( 'fromArray' )
198
-			->will( $this->throwException( new \RuntimeException() ) );
197
+		$object->expects($this->once())->method('fromArray')
198
+			->will($this->throwException(new \RuntimeException()));
199 199
 
200 200
 		$object->save();
201 201
 	}
@@ -203,10 +203,10 @@  discard block
 block discarded – undo
203 203
 
204 204
 	public function testSaveMShopException()
205 205
 	{
206
-		$object = $this->getClientMock( 'fromArray' );
206
+		$object = $this->getClientMock('fromArray');
207 207
 
208
-		$object->expects( $this->once() )->method( 'fromArray' )
209
-			->will( $this->throwException( new \RuntimeException() ) );
208
+		$object->expects($this->once())->method('fromArray')
209
+			->will($this->throwException(new \RuntimeException()));
210 210
 
211 211
 		$object->save();
212 212
 	}
@@ -214,10 +214,10 @@  discard block
 block discarded – undo
214 214
 
215 215
 	public function testSaveJQAdmException()
216 216
 	{
217
-		$object = $this->getClientMock( 'fromArray' );
217
+		$object = $this->getClientMock('fromArray');
218 218
 
219
-		$object->expects( $this->once() )->method( 'fromArray' )
220
-			->will( $this->throwException( new \RuntimeException() ) );
219
+		$object->expects($this->once())->method('fromArray')
220
+			->will($this->throwException(new \RuntimeException()));
221 221
 
222 222
 		$object->save();
223 223
 	}
@@ -228,27 +228,27 @@  discard block
 block discarded – undo
228 228
 		$param = array(
229 229
 			'lang' => 'de',
230 230
 			'filter' => array(
231
-				'key' => array( 0 => 'locale.language.code' ),
232
-				'op' => array( 0 => '==' ),
233
-				'val' => array( 0 => 'de' ),
231
+				'key' => array(0 => 'locale.language.code'),
232
+				'op' => array(0 => '=='),
233
+				'val' => array(0 => 'de'),
234 234
 			),
235
-			'sort' => array( '-locale.language.id' ),
235
+			'sort' => array('-locale.language.id'),
236 236
 		);
237
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
238
-		$this->view->addHelper( 'param', $helper );
237
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
238
+		$this->view->addHelper('param', $helper);
239 239
 
240 240
 		$result = $this->object->search();
241 241
 
242
-		$this->assertContains( '>de<', $result );
242
+		$this->assertContains('>de<', $result);
243 243
 	}
244 244
 
245 245
 
246 246
 	public function testSearchException()
247 247
 	{
248
-		$object = $this->getClientMock( 'initCriteria' );
248
+		$object = $this->getClientMock('initCriteria');
249 249
 
250
-		$object->expects( $this->once() )->method( 'initCriteria' )
251
-			->will( $this->throwException( new \RuntimeException() ) );
250
+		$object->expects($this->once())->method('initCriteria')
251
+			->will($this->throwException(new \RuntimeException()));
252 252
 
253 253
 		$object->search();
254 254
 	}
@@ -256,10 +256,10 @@  discard block
 block discarded – undo
256 256
 
257 257
 	public function testSearchMShopException()
258 258
 	{
259
-		$object = $this->getClientMock( 'initCriteria' );
259
+		$object = $this->getClientMock('initCriteria');
260 260
 
261
-		$object->expects( $this->once() )->method( 'initCriteria' )
262
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
261
+		$object->expects($this->once())->method('initCriteria')
262
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
263 263
 
264 264
 		$object->search();
265 265
 	}
@@ -267,27 +267,27 @@  discard block
 block discarded – undo
267 267
 
268 268
 	public function testGetSubClientInvalid()
269 269
 	{
270
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
271
-		$this->object->getSubClient( '$unknown$' );
270
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
271
+		$this->object->getSubClient('$unknown$');
272 272
 	}
273 273
 
274 274
 
275 275
 	public function testGetSubClientUnknown()
276 276
 	{
277
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
278
-		$this->object->getSubClient( 'unknown' );
277
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
278
+		$this->object->getSubClient('unknown');
279 279
 	}
280 280
 
281 281
 
282
-	public function getClientMock( $method )
282
+	public function getClientMock($method)
283 283
 	{
284
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Locale\Language\Standard' )
285
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
286
-			->setMethods( [$method] )
284
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Locale\Language\Standard')
285
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
286
+			->setMethods([$method])
287 287
 			->getMock();
288 288
 
289
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
290
-		$object->setView( $this->getViewNoRender() );
289
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
290
+		$object->setView($this->getViewNoRender());
291 291
 
292 292
 		return $object;
293 293
 	}
@@ -295,16 +295,16 @@  discard block
 block discarded – undo
295 295
 
296 296
 	protected function getViewNoRender()
297 297
 	{
298
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
299
-			->setConstructorArgs( array( [] ) )
300
-			->setMethods( array( 'render', 'config' ) )
298
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
299
+			->setConstructorArgs(array([]))
300
+			->setMethods(array('render', 'config'))
301 301
 			->getMock();
302 302
 
303
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['id' => 'de'] );
304
-		$view->addHelper( 'param', $helper );
303
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['id' => 'de']);
304
+		$view->addHelper('param', $helper);
305 305
 
306
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
307
-		$view->addHelper( 'access', $helper );
306
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
307
+		$view->addHelper('access', $helper);
308 308
 
309 309
 		return $view;
310 310
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Locale/Site/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -294,6 +294,9 @@
 block discarded – undo
294 294
 	}
295 295
 
296 296
 
297
+	/**
298
+	 * @param string $method
299
+	 */
297 300
 	public function getClientMock( $method )
298 301
 	{
299 302
 		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Locale\Site\Standard' )
Please login to merge, or discard this patch.
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -21,34 +21,34 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $this->view, ['super'] );
25
-		$this->view->addHelper( 'access', $helper );
24
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($this->view, ['super']);
25
+		$this->view->addHelper('access', $helper);
26 26
 
27
-		$this->object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard( $this->context );
28
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
29
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
30
-		$this->object->setView( $this->view );
27
+		$this->object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard($this->context);
28
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
29
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
30
+		$this->object->setView($this->view);
31 31
 	}
32 32
 
33 33
 
34 34
 	protected function tearDown()
35 35
 	{
36
-		unset( $this->object, $this->view, $this->context );
36
+		unset($this->object, $this->view, $this->context);
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreate()
41 41
 	{
42
-		$this->assertContains( 'item-locale-site', $this->object->create() );
42
+		$this->assertContains('item-locale-site', $this->object->create());
43 43
 	}
44 44
 
45 45
 
46 46
 	public function testCreateException()
47 47
 	{
48
-		$object = $this->getClientMock( 'getSubClients' );
48
+		$object = $this->getClientMock('getSubClients');
49 49
 
50
-		$object->expects( $this->once() )->method( 'getSubClients' )
51
-			->will( $this->throwException( new \RuntimeException() ) );
50
+		$object->expects($this->once())->method('getSubClients')
51
+			->will($this->throwException(new \RuntimeException()));
52 52
 
53 53
 		$object->create();
54 54
 	}
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 
57 57
 	public function testCreateMShopException()
58 58
 	{
59
-		$object = $this->getClientMock( 'getSubClients' );
59
+		$object = $this->getClientMock('getSubClients');
60 60
 
61
-		$object->expects( $this->once() )->method( 'getSubClients' )
62
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
61
+		$object->expects($this->once())->method('getSubClients')
62
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
63 63
 
64 64
 		$object->create();
65 65
 	}
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
 
68 68
 	public function testCopy()
69 69
 	{
70
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale/site' );
70
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'locale/site');
71 71
 
72
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unittest' )->getId()];
73
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
74
-		$this->view->addHelper( 'param', $helper );
72
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unittest')->getId()];
73
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
74
+		$this->view->addHelper('param', $helper);
75 75
 
76 76
 		$result = $this->object->copy();
77 77
 
78
-		$this->assertContains( 'unittest', $result );
78
+		$this->assertContains('unittest', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testCopyException()
83 83
 	{
84
-		$object = $this->getClientMock( 'getSubClients' );
84
+		$object = $this->getClientMock('getSubClients');
85 85
 
86
-		$object->expects( $this->once() )->method( 'getSubClients' )
87
-			->will( $this->throwException( new \RuntimeException() ) );
86
+		$object->expects($this->once())->method('getSubClients')
87
+			->will($this->throwException(new \RuntimeException()));
88 88
 
89 89
 		$object->copy();
90 90
 	}
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
 
93 93
 	public function testCopyMShopException()
94 94
 	{
95
-		$object = $this->getClientMock( 'getSubClients' );
95
+		$object = $this->getClientMock('getSubClients');
96 96
 
97
-		$object->expects( $this->once() )->method( 'getSubClients' )
98
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
97
+		$object->expects($this->once())->method('getSubClients')
98
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
99 99
 
100 100
 		$object->copy();
101 101
 	}
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
 
104 104
 	public function testDelete()
105 105
 	{
106
-		$this->assertNotNull( $this->object->delete() );
106
+		$this->assertNotNull($this->object->delete());
107 107
 	}
108 108
 
109 109
 
110 110
 	public function testDeleteException()
111 111
 	{
112
-		$object = $this->getClientMock( 'getSubClients' );
112
+		$object = $this->getClientMock('getSubClients');
113 113
 
114
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
115
-			->will( $this->throwException( new \RuntimeException() ) );
114
+		$object->expects($this->exactly(2))->method('getSubClients')
115
+			->will($this->throwException(new \RuntimeException()));
116 116
 
117 117
 		$object->delete();
118 118
 	}
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
 
121 121
 	public function testDeleteMShopException()
122 122
 	{
123
-		$object = $this->getClientMock( 'getSubClients' );
123
+		$object = $this->getClientMock('getSubClients');
124 124
 
125
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
126
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
125
+		$object->expects($this->exactly(2))->method('getSubClients')
126
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
127 127
 
128 128
 		$object->delete();
129 129
 	}
@@ -131,24 +131,24 @@  discard block
 block discarded – undo
131 131
 
132 132
 	public function testGet()
133 133
 	{
134
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale/site' );
134
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'locale/site');
135 135
 
136
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unittest' )->getId()];
137
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
138
-		$this->view->addHelper( 'param', $helper );
136
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unittest')->getId()];
137
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
138
+		$this->view->addHelper('param', $helper);
139 139
 
140 140
 		$result = $this->object->get();
141 141
 
142
-		$this->assertContains( 'unittest', $result );
142
+		$this->assertContains('unittest', $result);
143 143
 	}
144 144
 
145 145
 
146 146
 	public function testGetException()
147 147
 	{
148
-		$object = $this->getClientMock( 'getSubClients' );
148
+		$object = $this->getClientMock('getSubClients');
149 149
 
150
-		$object->expects( $this->once() )->method( 'getSubClients' )
151
-			->will( $this->throwException( new \RuntimeException() ) );
150
+		$object->expects($this->once())->method('getSubClients')
151
+			->will($this->throwException(new \RuntimeException()));
152 152
 
153 153
 		$object->get();
154 154
 	}
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
 
157 157
 	public function testGetMShopException()
158 158
 	{
159
-		$object = $this->getClientMock( 'getSubClients' );
159
+		$object = $this->getClientMock('getSubClients');
160 160
 
161
-		$object->expects( $this->once() )->method( 'getSubClients' )
162
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
161
+		$object->expects($this->once())->method('getSubClients')
162
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
163 163
 
164 164
 		$object->get();
165 165
 	}
@@ -167,16 +167,16 @@  discard block
 block discarded – undo
167 167
 
168 168
 	public function testGetViewException()
169 169
 	{
170
-		$object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard( $this->context, [] );
170
+		$object = new \Aimeos\Admin\JQAdm\Locale\Site\Standard($this->context, []);
171 171
 
172
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
172
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
173 173
 		$object->getView();
174 174
 	}
175 175
 
176 176
 
177 177
 	public function testSave()
178 178
 	{
179
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale/site' );
179
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'locale/site');
180 180
 
181 181
 		$param = array(
182 182
 			'site' => 'unittest',
@@ -192,24 +192,24 @@  discard block
 block discarded – undo
192 192
 			),
193 193
 		);
194 194
 
195
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
196
-		$this->view->addHelper( 'param', $helper );
195
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
196
+		$this->view->addHelper('param', $helper);
197 197
 
198 198
 		$this->object->save();
199 199
 
200
-		$item = $manager->findItem( 'jqadm@test' );
201
-		$manager->deleteItem( $item->getId() );
200
+		$item = $manager->findItem('jqadm@test');
201
+		$manager->deleteItem($item->getId());
202 202
 
203
-		$this->assertEquals( ['test' => 'value'], $item->getConfig() );
203
+		$this->assertEquals(['test' => 'value'], $item->getConfig());
204 204
 	}
205 205
 
206 206
 
207 207
 	public function testSaveException()
208 208
 	{
209
-		$object = $this->getClientMock( 'fromArray' );
209
+		$object = $this->getClientMock('fromArray');
210 210
 
211
-		$object->expects( $this->once() )->method( 'fromArray' )
212
-			->will( $this->throwException( new \RuntimeException() ) );
211
+		$object->expects($this->once())->method('fromArray')
212
+			->will($this->throwException(new \RuntimeException()));
213 213
 
214 214
 		$object->save();
215 215
 	}
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 
218 218
 	public function testSaveMShopException()
219 219
 	{
220
-		$object = $this->getClientMock( 'fromArray' );
220
+		$object = $this->getClientMock('fromArray');
221 221
 
222
-		$object->expects( $this->once() )->method( 'fromArray' )
223
-			->will( $this->throwException( new \RuntimeException() ) );
222
+		$object->expects($this->once())->method('fromArray')
223
+			->will($this->throwException(new \RuntimeException()));
224 224
 
225 225
 		$object->save();
226 226
 	}
@@ -228,10 +228,10 @@  discard block
 block discarded – undo
228 228
 
229 229
 	public function testSaveJQAdmException()
230 230
 	{
231
-		$object = $this->getClientMock( 'fromArray' );
231
+		$object = $this->getClientMock('fromArray');
232 232
 
233
-		$object->expects( $this->once() )->method( 'fromArray' )
234
-			->will( $this->throwException( new \RuntimeException() ) );
233
+		$object->expects($this->once())->method('fromArray')
234
+			->will($this->throwException(new \RuntimeException()));
235 235
 
236 236
 		$object->save();
237 237
 	}
@@ -242,27 +242,27 @@  discard block
 block discarded – undo
242 242
 		$param = array(
243 243
 			'site' => 'unittest', 'lang' => 'de',
244 244
 			'filter' => array(
245
-				'key' => array( 0 => 'locale.site.code' ),
246
-				'op' => array( 0 => '==' ),
247
-				'val' => array( 0 => 'unittest' ),
245
+				'key' => array(0 => 'locale.site.code'),
246
+				'op' => array(0 => '=='),
247
+				'val' => array(0 => 'unittest'),
248 248
 			),
249
-			'sort' => array( '-locale.site.id' ),
249
+			'sort' => array('-locale.site.id'),
250 250
 		);
251
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
252
-		$this->view->addHelper( 'param', $helper );
251
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
252
+		$this->view->addHelper('param', $helper);
253 253
 
254 254
 		$result = $this->object->search();
255 255
 
256
-		$this->assertContains( '>unittest<', $result );
256
+		$this->assertContains('>unittest<', $result);
257 257
 	}
258 258
 
259 259
 
260 260
 	public function testSearchException()
261 261
 	{
262
-		$object = $this->getClientMock( 'initCriteria' );
262
+		$object = $this->getClientMock('initCriteria');
263 263
 
264
-		$object->expects( $this->once() )->method( 'initCriteria' )
265
-			->will( $this->throwException( new \RuntimeException() ) );
264
+		$object->expects($this->once())->method('initCriteria')
265
+			->will($this->throwException(new \RuntimeException()));
266 266
 
267 267
 		$object->search();
268 268
 	}
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
 
271 271
 	public function testSearchMShopException()
272 272
 	{
273
-		$object = $this->getClientMock( 'initCriteria' );
273
+		$object = $this->getClientMock('initCriteria');
274 274
 
275
-		$object->expects( $this->once() )->method( 'initCriteria' )
276
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
275
+		$object->expects($this->once())->method('initCriteria')
276
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
277 277
 
278 278
 		$object->search();
279 279
 	}
@@ -281,27 +281,27 @@  discard block
 block discarded – undo
281 281
 
282 282
 	public function testGetSubClientInvalid()
283 283
 	{
284
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
285
-		$this->object->getSubClient( '$unknown$' );
284
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
285
+		$this->object->getSubClient('$unknown$');
286 286
 	}
287 287
 
288 288
 
289 289
 	public function testGetSubClientUnknown()
290 290
 	{
291
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
292
-		$this->object->getSubClient( 'unknown' );
291
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
292
+		$this->object->getSubClient('unknown');
293 293
 	}
294 294
 
295 295
 
296
-	public function getClientMock( $method )
296
+	public function getClientMock($method)
297 297
 	{
298
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Locale\Site\Standard' )
299
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
300
-			->setMethods( [$method] )
298
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Locale\Site\Standard')
299
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
300
+			->setMethods([$method])
301 301
 			->getMock();
302 302
 
303
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
304
-		$object->setView( $this->getViewNoRender() );
303
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
304
+		$object->setView($this->getViewNoRender());
305 305
 
306 306
 		return $object;
307 307
 	}
@@ -309,19 +309,19 @@  discard block
 block discarded – undo
309 309
 
310 310
 	protected function getViewNoRender()
311 311
 	{
312
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
313
-			->setConstructorArgs( array( [] ) )
314
-			->setMethods( array( 'render', 'config' ) )
312
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
313
+			->setConstructorArgs(array([]))
314
+			->setMethods(array('render', 'config'))
315 315
 			->getMock();
316 316
 
317
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale/site' );
317
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'locale/site');
318 318
 
319
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unittest' )->getId()];
320
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
321
-		$view->addHelper( 'param', $helper );
319
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unittest')->getId()];
320
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
321
+		$view->addHelper('param', $helper);
322 322
 
323
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $this->view, ['super'] );
324
-		$view->addHelper( 'access', $helper );
323
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($this->view, ['super']);
324
+		$view->addHelper('access', $helper);
325 325
 
326 326
 		return $view;
327 327
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Locale/StandardTest.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -281,6 +281,9 @@  discard block
 block discarded – undo
281 281
 	}
282 282
 
283 283
 
284
+	/**
285
+	 * @param string $method
286
+	 */
284 287
 	public function getClientMock( $method )
285 288
 	{
286 289
 		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Locale\Standard' )
@@ -313,6 +316,10 @@  discard block
 block discarded – undo
313 316
 	}
314 317
 
315 318
 
319
+	/**
320
+	 * @param string $langid
321
+	 * @param string $currid
322
+	 */
316 323
 	protected function getItem( $langid = null, $currid = null )
317 324
 	{
318 325
 		$manager = \Aimeos\MShop\Factory::createManager( $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' );
165
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
166 166
 		$object->getView();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSave()
171 171
 	{
172
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'locale' );
172
+		$manager = \Aimeos\MShop\Factory::createManager($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' );
272
-		$this->object->getSubClient( '$unknown$' );
271
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' );
279
-		$this->object->getSubClient( 'unknown' );
278
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
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' )
286
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
287
-			->setMethods( [$method] )
285
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Locale\Standard')
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' )
300
-			->setConstructorArgs( array( [] ) )
301
-			->setMethods( array( 'render', 'config' ) )
299
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
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\Factory::createManager( $this->context, 'locale' );
317
+		$manager = \Aimeos\MShop\Factory::createManager($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/Admin/JQAdm/Plugin/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -295,6 +295,9 @@
 block discarded – undo
295 295
 	}
296 296
 
297 297
 
298
+	/**
299
+	 * @param string $method
300
+	 */
298 301
 	public function getClientMock( $method )
299 302
 	{
300 303
 		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Plugin\Standard' )
Please login to merge, or discard this patch.
Spacing   +95 added lines, -95 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\Plugin\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Plugin\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
@@ -42,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
 	}
@@ -65,21 +65,21 @@  discard block
 block discarded – undo
65 65
 	public function testCopy()
66 66
 	{
67 67
 		$param = ['site' => 'unittest', 'id' => $this->getItem()->getId()];
68
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
69
-		$this->view->addHelper( 'param', $helper );
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( 'Shipping-Plugin', $result );
73
+		$this->assertContains('Shipping-Plugin', $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
 	}
@@ -127,21 +127,21 @@  discard block
 block discarded – undo
127 127
 	public function testGet()
128 128
 	{
129 129
 		$param = ['site' => 'unittest', 'id' => $this->getItem()->getId()];
130
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
131
-		$this->view->addHelper( 'param', $helper );
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( 'Shipping-Plugin', $result );
135
+		$this->assertContains('Shipping-Plugin', $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,24 +160,24 @@  discard block
 block discarded – undo
160 160
 
161 161
 	public function testGetViewException()
162 162
 	{
163
-		$object = new \Aimeos\Admin\JQAdm\Plugin\Standard( $this->context, [] );
163
+		$object = new \Aimeos\Admin\JQAdm\Plugin\Standard($this->context, []);
164 164
 
165
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
165
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
166 166
 		$object->getView();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSave()
171 171
 	{
172
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'plugin' );
173
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'plugin/type' );
172
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'plugin');
173
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'plugin/type');
174 174
 
175 175
 		$search = $typeManager->createSearch();
176
-		$search->setSlice( 0, 1 );
177
-		$typeItems = $typeManager->searchItems( $search );
176
+		$search->setSlice(0, 1);
177
+		$typeItems = $typeManager->searchItems($search);
178 178
 
179
-		if( ( $typeItem = reset( $typeItems ) ) === false ) {
180
-			throw new \RuntimeException( 'No plugin type item found' );
179
+		if (($typeItem = reset($typeItems)) === false) {
180
+			throw new \RuntimeException('No plugin type item found');
181 181
 		}
182 182
 
183 183
 
@@ -190,27 +190,27 @@  discard block
 block discarded – undo
190 190
 				'plugin.label' => 'test label',
191 191
 				'plugin.position' => '2',
192 192
 				'config' => array(
193
-					'key' => array( 0 => 'test key' ),
194
-					'val' => array( 0 => 'test value' ),
193
+					'key' => array(0 => 'test key'),
194
+					'val' => array(0 => 'test value'),
195 195
 				),
196 196
 			),
197 197
 		);
198 198
 
199
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
200
-		$this->view->addHelper( 'param', $helper );
199
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
200
+		$this->view->addHelper('param', $helper);
201 201
 
202 202
 		$this->object->save();
203 203
 
204
-		$manager->deleteItem( $this->getItem( 'test label' )->getId() );
204
+		$manager->deleteItem($this->getItem('test label')->getId());
205 205
 	}
206 206
 
207 207
 
208 208
 	public function testSaveException()
209 209
 	{
210
-		$object = $this->getClientMock( 'fromArray' );
210
+		$object = $this->getClientMock('fromArray');
211 211
 
212
-		$object->expects( $this->once() )->method( 'fromArray' )
213
-			->will( $this->throwException( new \RuntimeException() ) );
212
+		$object->expects($this->once())->method('fromArray')
213
+			->will($this->throwException(new \RuntimeException()));
214 214
 
215 215
 		$object->save();
216 216
 	}
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
 
219 219
 	public function testSaveMShopException()
220 220
 	{
221
-		$object = $this->getClientMock( 'fromArray' );
221
+		$object = $this->getClientMock('fromArray');
222 222
 
223
-		$object->expects( $this->once() )->method( 'fromArray' )
224
-			->will( $this->throwException( new \RuntimeException() ) );
223
+		$object->expects($this->once())->method('fromArray')
224
+			->will($this->throwException(new \RuntimeException()));
225 225
 
226 226
 		$object->save();
227 227
 	}
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
 
230 230
 	public function testSaveJQAdmException()
231 231
 	{
232
-		$object = $this->getClientMock( 'fromArray' );
232
+		$object = $this->getClientMock('fromArray');
233 233
 
234
-		$object->expects( $this->once() )->method( 'fromArray' )
235
-			->will( $this->throwException( new \RuntimeException() ) );
234
+		$object->expects($this->once())->method('fromArray')
235
+			->will($this->throwException(new \RuntimeException()));
236 236
 
237 237
 		$object->save();
238 238
 	}
@@ -243,27 +243,27 @@  discard block
 block discarded – undo
243 243
 		$param = array(
244 244
 			'site' => 'unittest', 'lang' => 'de',
245 245
 			'filter' => array(
246
-				'key' => array( 0 => 'plugin.label' ),
247
-				'op' => array( 0 => '==' ),
248
-				'val' => array( 0 => 'Shipping-Plugin' ),
246
+				'key' => array(0 => 'plugin.label'),
247
+				'op' => array(0 => '=='),
248
+				'val' => array(0 => 'Shipping-Plugin'),
249 249
 			),
250
-			'sort' => array( 'plugin.label', '-plugin.id' ),
250
+			'sort' => array('plugin.label', '-plugin.id'),
251 251
 		);
252
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
253
-		$this->view->addHelper( 'param', $helper );
252
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
253
+		$this->view->addHelper('param', $helper);
254 254
 
255 255
 		$result = $this->object->search();
256 256
 
257
-		$this->assertContains( '>Shipping-Plugin<', $result );
257
+		$this->assertContains('>Shipping-Plugin<', $result);
258 258
 	}
259 259
 
260 260
 
261 261
 	public function testSearchException()
262 262
 	{
263
-		$object = $this->getClientMock( 'initCriteria' );
263
+		$object = $this->getClientMock('initCriteria');
264 264
 
265
-		$object->expects( $this->once() )->method( 'initCriteria' )
266
-			->will( $this->throwException( new \RuntimeException() ) );
265
+		$object->expects($this->once())->method('initCriteria')
266
+			->will($this->throwException(new \RuntimeException()));
267 267
 
268 268
 		$object->search();
269 269
 	}
@@ -271,10 +271,10 @@  discard block
 block discarded – undo
271 271
 
272 272
 	public function testSearchMShopException()
273 273
 	{
274
-		$object = $this->getClientMock( 'initCriteria' );
274
+		$object = $this->getClientMock('initCriteria');
275 275
 
276
-		$object->expects( $this->once() )->method( 'initCriteria' )
277
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
276
+		$object->expects($this->once())->method('initCriteria')
277
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
278 278
 
279 279
 		$object->search();
280 280
 	}
@@ -282,27 +282,27 @@  discard block
 block discarded – undo
282 282
 
283 283
 	public function testGetSubClientInvalid()
284 284
 	{
285
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
286
-		$this->object->getSubClient( '$unknown$' );
285
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
286
+		$this->object->getSubClient('$unknown$');
287 287
 	}
288 288
 
289 289
 
290 290
 	public function testGetSubClientUnknown()
291 291
 	{
292
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
293
-		$this->object->getSubClient( 'unknown' );
292
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
293
+		$this->object->getSubClient('unknown');
294 294
 	}
295 295
 
296 296
 
297
-	public function getClientMock( $method )
297
+	public function getClientMock($method)
298 298
 	{
299
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Plugin\Standard' )
300
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
301
-			->setMethods( [$method] )
299
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Plugin\Standard')
300
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
301
+			->setMethods([$method])
302 302
 			->getMock();
303 303
 
304
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
305
-		$object->setView( $this->getViewNoRender() );
304
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
305
+		$object->setView($this->getViewNoRender());
306 306
 
307 307
 		return $object;
308 308
 	}
@@ -310,34 +310,34 @@  discard block
 block discarded – undo
310 310
 
311 311
 	protected function getViewNoRender()
312 312
 	{
313
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
314
-			->setConstructorArgs( array( [] ) )
315
-			->setMethods( array( 'render', 'config' ) )
313
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
314
+			->setConstructorArgs(array([]))
315
+			->setMethods(array('render', 'config'))
316 316
 			->getMock();
317 317
 
318 318
 		$param = ['site' => 'unittest', 'id' => $this->getItem()->getId()];
319
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
320
-		$view->addHelper( 'param', $helper );
319
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
320
+		$view->addHelper('param', $helper);
321 321
 
322
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
323
-		$view->addHelper( 'access', $helper );
322
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
323
+		$view->addHelper('access', $helper);
324 324
 
325 325
 		return $view;
326 326
 	}
327 327
 
328 328
 
329
-	protected function getItem( $label = 'Shipping-Plugin' )
329
+	protected function getItem($label = 'Shipping-Plugin')
330 330
 	{
331
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'plugin' );
331
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'plugin');
332 332
 
333 333
 		$search = $manager->createSearch();
334
-		$search->setConditions( $search->compare( '==', 'plugin.label', $label ) );
335
-		$search->setSlice( 0, 1 );
334
+		$search->setConditions($search->compare('==', 'plugin.label', $label));
335
+		$search->setSlice(0, 1);
336 336
 
337
-		$items = $manager->searchItems( $search );
337
+		$items = $manager->searchItems($search);
338 338
 
339
-		if( ( $item = reset( $items ) ) === false ) {
340
-			throw new \Exception( sprintf( 'No plugin with label "%1$s" found', $label ) );
339
+		if (($item = reset($items)) === false) {
340
+			throw new \Exception(sprintf('No plugin with label "%1$s" found', $label));
341 341
 		}
342 342
 
343 343
 		return $item;
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -329,6 +329,9 @@
 block discarded – undo
329 329
 	}
330 330
 
331 331
 
332
+	/**
333
+	 * @param string $method
334
+	 */
332 335
 	public function getClientMock( $method )
333 336
 	{
334 337
 		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
Please login to merge, or discard this patch.
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 	protected function setUp()
20 20
 	{
21 21
 		$this->view = \TestHelperJqadm::getView();
22
-		$request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context );
29
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
30
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
31
-		$this->object->setView( $this->view );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context);
29
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
30
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
31
+		$this->object->setView($this->view);
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->view, $this->context );
37
+		unset($this->object, $this->view, $this->context);
38 38
 	}
39 39
 
40 40
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function testCreateException()
48 48
 	{
49
-		$object = $this->getClientMock( 'getSubClients' );
49
+		$object = $this->getClientMock('getSubClients');
50 50
 
51
-		$object->expects( $this->once() )->method( 'getSubClients' )
52
-			->will( $this->throwException( new \RuntimeException() ) );
51
+		$object->expects($this->once())->method('getSubClients')
52
+			->will($this->throwException(new \RuntimeException()));
53 53
 
54 54
 		$object->create();
55 55
 	}
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function testCreateMShopException()
59 59
 	{
60
-		$object = $this->getClientMock( 'getSubClients' );
60
+		$object = $this->getClientMock('getSubClients');
61 61
 
62
-		$object->expects( $this->once() )->method( 'getSubClients' )
63
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
62
+		$object->expects($this->once())->method('getSubClients')
63
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
64 64
 
65 65
 		$object->create();
66 66
 	}
@@ -68,24 +68,24 @@  discard block
 block discarded – undo
68 68
 
69 69
 	public function testCopy()
70 70
 	{
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
72 72
 
73
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'CNC' )->getId()];
74
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
75
-		$this->view->addHelper( 'param', $helper );
73
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('CNC')->getId()];
74
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
75
+		$this->view->addHelper('param', $helper);
76 76
 
77 77
 		$result = $this->object->copy();
78 78
 
79
-		$this->assertContains( 'CNC_copy', $result );
79
+		$this->assertContains('CNC_copy', $result);
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testCopyException()
84 84
 	{
85
-		$object = $this->getClientMock( 'getSubClients' );
85
+		$object = $this->getClientMock('getSubClients');
86 86
 
87
-		$object->expects( $this->once() )->method( 'getSubClients' )
88
-			->will( $this->throwException( new \RuntimeException() ) );
87
+		$object->expects($this->once())->method('getSubClients')
88
+			->will($this->throwException(new \RuntimeException()));
89 89
 
90 90
 		$object->copy();
91 91
 	}
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 
94 94
 	public function testCopyMShopException()
95 95
 	{
96
-		$object = $this->getClientMock( 'getSubClients' );
96
+		$object = $this->getClientMock('getSubClients');
97 97
 
98
-		$object->expects( $this->once() )->method( 'getSubClients' )
99
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
98
+		$object->expects($this->once())->method('getSubClients')
99
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testDelete()
106 106
 	{
107
-		$this->assertNotNull( $this->object->delete() );
107
+		$this->assertNotNull($this->object->delete());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testDeleteException()
112 112
 	{
113
-		$object = $this->getClientMock( 'getSubClients' );
113
+		$object = $this->getClientMock('getSubClients');
114 114
 
115
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
116
-			->will( $this->throwException( new \RuntimeException() ) );
115
+		$object->expects($this->exactly(2))->method('getSubClients')
116
+			->will($this->throwException(new \RuntimeException()));
117 117
 
118 118
 		$object->delete();
119 119
 	}
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
 	public function testDeleteMShopException()
123 123
 	{
124
-		$object = $this->getClientMock( 'getSubClients' );
124
+		$object = $this->getClientMock('getSubClients');
125 125
 
126
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
127
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
126
+		$object->expects($this->exactly(2))->method('getSubClients')
127
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
128 128
 
129 129
 		$object->delete();
130 130
 	}
@@ -132,24 +132,24 @@  discard block
 block discarded – undo
132 132
 
133 133
 	public function testGet()
134 134
 	{
135
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
135
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
136 136
 
137
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'CNC' )->getId()];
138
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
139
-		$this->view->addHelper( 'param', $helper );
137
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('CNC')->getId()];
138
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
139
+		$this->view->addHelper('param', $helper);
140 140
 
141 141
 		$result = $this->object->get();
142 142
 
143
-		$this->assertContains( 'CNC', $result );
143
+		$this->assertContains('CNC', $result);
144 144
 	}
145 145
 
146 146
 
147 147
 	public function testGetException()
148 148
 	{
149
-		$object = $this->getClientMock( 'getSubClients' );
149
+		$object = $this->getClientMock('getSubClients');
150 150
 
151
-		$object->expects( $this->once() )->method( 'getSubClients' )
152
-			->will( $this->throwException( new \RuntimeException() ) );
151
+		$object->expects($this->once())->method('getSubClients')
152
+			->will($this->throwException(new \RuntimeException()));
153 153
 
154 154
 		$object->get();
155 155
 	}
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 
158 158
 	public function testGetMShopException()
159 159
 	{
160
-		$object = $this->getClientMock( 'getSubClients' );
160
+		$object = $this->getClientMock('getSubClients');
161 161
 
162
-		$object->expects( $this->once() )->method( 'getSubClients' )
163
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
162
+		$object->expects($this->once())->method('getSubClients')
163
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
164 164
 
165 165
 		$object->get();
166 166
 	}
@@ -168,19 +168,19 @@  discard block
 block discarded – undo
168 168
 
169 169
 	public function testGetViewException()
170 170
 	{
171
-		$object = new \Aimeos\Admin\JQAdm\Product\Standard( $this->context, [] );
171
+		$object = new \Aimeos\Admin\JQAdm\Product\Standard($this->context, []);
172 172
 
173
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
173
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
174 174
 		$object->getView();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSave()
179 179
 	{
180
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
181
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'product/type' );
180
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
181
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'product/type');
182 182
 
183
-		$typeId = $typeManager->findItem( 'default', [], 'product' )->getId();
183
+		$typeId = $typeManager->findItem('default', [], 'product')->getId();
184 184
 
185 185
 		$param = array(
186 186
 			'site' => 'unittest',
@@ -192,27 +192,27 @@  discard block
 block discarded – undo
192 192
 				'product.datestart' => null,
193 193
 				'product.dateend' => null,
194 194
 				'config' => array(
195
-					'key' => array( 0 => 'test key' ),
196
-					'val' => array( 0 => 'test value' ),
195
+					'key' => array(0 => 'test key'),
196
+					'val' => array(0 => 'test value'),
197 197
 				),
198 198
 			),
199 199
 		);
200 200
 
201
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
202
-		$this->view->addHelper( 'param', $helper );
201
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
202
+		$this->view->addHelper('param', $helper);
203 203
 
204 204
 		$this->object->save();
205 205
 
206
-		$manager->deleteItem( $manager->findItem( 'test' )->getId() );
206
+		$manager->deleteItem($manager->findItem('test')->getId());
207 207
 	}
208 208
 
209 209
 
210 210
 	public function testSaveException()
211 211
 	{
212
-		$object = $this->getClientMock( 'fromArray' );
212
+		$object = $this->getClientMock('fromArray');
213 213
 
214
-		$object->expects( $this->once() )->method( 'fromArray' )
215
-			->will( $this->throwException( new \RuntimeException() ) );
214
+		$object->expects($this->once())->method('fromArray')
215
+			->will($this->throwException(new \RuntimeException()));
216 216
 
217 217
 		$object->save();
218 218
 	}
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 
221 221
 	public function testSaveMShopException()
222 222
 	{
223
-		$object = $this->getClientMock( 'fromArray' );
223
+		$object = $this->getClientMock('fromArray');
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 228
 		$object->save();
229 229
 	}
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
 
232 232
 	public function testSaveJQAdmException()
233 233
 	{
234
-		$object = $this->getClientMock( 'fromArray' );
234
+		$object = $this->getClientMock('fromArray');
235 235
 
236
-		$object->expects( $this->once() )->method( 'fromArray' )
237
-			->will( $this->throwException( new \RuntimeException() ) );
236
+		$object->expects($this->once())->method('fromArray')
237
+			->will($this->throwException(new \RuntimeException()));
238 238
 
239 239
 		$object->save();
240 240
 	}
@@ -245,27 +245,27 @@  discard block
 block discarded – undo
245 245
 		$param = array(
246 246
 			'site' => 'unittest', 'lang' => 'de',
247 247
 			'filter' => array(
248
-				'key' => array( 0 => 'product.code' ),
249
-				'op' => array( 0 => '==' ),
250
-				'val' => array( 0 => 'CNE' ),
248
+				'key' => array(0 => 'product.code'),
249
+				'op' => array(0 => '=='),
250
+				'val' => array(0 => 'CNE'),
251 251
 			),
252
-			'sort' => array( 'product.label', '-product.id' ),
252
+			'sort' => array('product.label', '-product.id'),
253 253
 		);
254
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
255
-		$this->view->addHelper( 'param', $helper );
254
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
255
+		$this->view->addHelper('param', $helper);
256 256
 
257 257
 		$result = $this->object->search();
258 258
 
259
-		$this->assertContains( '>CNE<', $result );
259
+		$this->assertContains('>CNE<', $result);
260 260
 	}
261 261
 
262 262
 
263 263
 	public function testSearchException()
264 264
 	{
265
-		$object = $this->getClientMock( 'initCriteria' );
265
+		$object = $this->getClientMock('initCriteria');
266 266
 
267
-		$object->expects( $this->once() )->method( 'initCriteria' )
268
-			->will( $this->throwException( new \RuntimeException() ) );
267
+		$object->expects($this->once())->method('initCriteria')
268
+			->will($this->throwException(new \RuntimeException()));
269 269
 
270 270
 		$object->search();
271 271
 	}
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
 
274 274
 	public function testSearchMShopException()
275 275
 	{
276
-		$object = $this->getClientMock( 'initCriteria' );
276
+		$object = $this->getClientMock('initCriteria');
277 277
 
278
-		$object->expects( $this->once() )->method( 'initCriteria' )
279
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
278
+		$object->expects($this->once())->method('initCriteria')
279
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
280 280
 
281 281
 		$object->search();
282 282
 	}
@@ -284,52 +284,52 @@  discard block
 block discarded – undo
284 284
 
285 285
 	public function testGetSubClient()
286 286
 	{
287
-		$result = $this->object->getSubClient( 'image' );
288
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
287
+		$result = $this->object->getSubClient('image');
288
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
289 289
 	}
290 290
 
291 291
 
292 292
 	public function testGetSubClientInvalid()
293 293
 	{
294
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
295
-		$this->object->getSubClient( '$unknown$' );
294
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
295
+		$this->object->getSubClient('$unknown$');
296 296
 	}
297 297
 
298 298
 
299 299
 	public function testGetSubClientUnknown()
300 300
 	{
301
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
302
-		$this->object->getSubClient( 'unknown' );
301
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
302
+		$this->object->getSubClient('unknown');
303 303
 	}
304 304
 
305 305
 
306 306
 	public function testGetSubClientDecorators()
307 307
 	{
308
-		$this->context->getConfig()->set( 'admin/jqadm/product/image/decorators/global', array( 'Cache' ) );
308
+		$this->context->getConfig()->set('admin/jqadm/product/image/decorators/global', array('Cache'));
309 309
 
310
-		$result = $this->object->getSubClient( 'image' );
311
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
310
+		$result = $this->object->getSubClient('image');
311
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
312 312
 	}
313 313
 
314 314
 
315 315
 	public function testGetSubClientDecoratorInvalid()
316 316
 	{
317
-		$this->context->getConfig()->set( 'admin/jqadm/product/image/decorators/global', array( 'Invalid' ) );
317
+		$this->context->getConfig()->set('admin/jqadm/product/image/decorators/global', array('Invalid'));
318 318
 
319
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
320
-		$this->object->getSubClient( 'image' );
319
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
320
+		$this->object->getSubClient('image');
321 321
 	}
322 322
 
323 323
 
324
-	public function getClientMock( $method )
324
+	public function getClientMock($method)
325 325
 	{
326
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Product\Standard' )
327
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
328
-			->setMethods( [$method] )
326
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Product\Standard')
327
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
328
+			->setMethods([$method])
329 329
 			->getMock();
330 330
 
331
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
332
-		$object->setView( $this->getViewNoRender() );
331
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
332
+		$object->setView($this->getViewNoRender());
333 333
 
334 334
 		return $object;
335 335
 	}
@@ -337,19 +337,19 @@  discard block
 block discarded – undo
337 337
 
338 338
 	protected function getViewNoRender()
339 339
 	{
340
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
341
-			->setConstructorArgs( array( [] ) )
342
-			->setMethods( array( 'render', 'config' ) )
340
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
341
+			->setConstructorArgs(array([]))
342
+			->setMethods(array('render', 'config'))
343 343
 			->getMock();
344 344
 
345
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'product' );
345
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'product');
346 346
 
347
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'CNC' )->getId()];
348
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
349
-		$view->addHelper( 'param', $helper );
347
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('CNC')->getId()];
348
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
349
+		$view->addHelper('param', $helper);
350 350
 
351
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
352
-		$view->addHelper( 'access', $helper );
351
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
352
+		$view->addHelper('access', $helper);
353 353
 
354 354
 		return $view;
355 355
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Service/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -313,6 +313,9 @@
 block discarded – undo
313 313
 	}
314 314
 
315 315
 
316
+	/**
317
+	 * @param string $method
318
+	 */
316 319
 	public function getClientMock( $method )
317 320
 	{
318 321
 		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Service\Standard' )
Please login to merge, or discard this patch.
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 	protected function setUp()
20 20
 	{
21 21
 		$this->view = \TestHelperJqadm::getView();
22
-		$request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Service\Standard( $this->context );
29
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
30
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
31
-		$this->object->setView( $this->view );
28
+		$this->object = new \Aimeos\Admin\JQAdm\Service\Standard($this->context);
29
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
30
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
31
+		$this->object->setView($this->view);
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->view, $this->context );
37
+		unset($this->object, $this->view, $this->context);
38 38
 	}
39 39
 
40 40
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
 	public function testCreateException()
48 48
 	{
49
-		$object = $this->getClientMock( 'getSubClients' );
49
+		$object = $this->getClientMock('getSubClients');
50 50
 
51
-		$object->expects( $this->once() )->method( 'getSubClients' )
52
-			->will( $this->throwException( new \RuntimeException() ) );
51
+		$object->expects($this->once())->method('getSubClients')
52
+			->will($this->throwException(new \RuntimeException()));
53 53
 
54 54
 		$object->create();
55 55
 	}
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
 
58 58
 	public function testCreateMShopException()
59 59
 	{
60
-		$object = $this->getClientMock( 'getSubClients' );
60
+		$object = $this->getClientMock('getSubClients');
61 61
 
62
-		$object->expects( $this->once() )->method( 'getSubClients' )
63
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
62
+		$object->expects($this->once())->method('getSubClients')
63
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
64 64
 
65 65
 		$object->create();
66 66
 	}
@@ -68,24 +68,24 @@  discard block
 block discarded – undo
68 68
 
69 69
 	public function testCopy()
70 70
 	{
71
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' );
71
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'service');
72 72
 
73
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unitpaymentcode' )->getId()];
74
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
75
-		$this->view->addHelper( 'param', $helper );
73
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unitpaymentcode')->getId()];
74
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
75
+		$this->view->addHelper('param', $helper);
76 76
 
77 77
 		$result = $this->object->copy();
78 78
 
79
-		$this->assertContains( 'unitpaymentcode_copy', $result );
79
+		$this->assertContains('unitpaymentcode_copy', $result);
80 80
 	}
81 81
 
82 82
 
83 83
 	public function testCopyException()
84 84
 	{
85
-		$object = $this->getClientMock( 'getSubClients' );
85
+		$object = $this->getClientMock('getSubClients');
86 86
 
87
-		$object->expects( $this->once() )->method( 'getSubClients' )
88
-			->will( $this->throwException( new \RuntimeException() ) );
87
+		$object->expects($this->once())->method('getSubClients')
88
+			->will($this->throwException(new \RuntimeException()));
89 89
 
90 90
 		$object->copy();
91 91
 	}
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
 
94 94
 	public function testCopyMShopException()
95 95
 	{
96
-		$object = $this->getClientMock( 'getSubClients' );
96
+		$object = $this->getClientMock('getSubClients');
97 97
 
98
-		$object->expects( $this->once() )->method( 'getSubClients' )
99
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
98
+		$object->expects($this->once())->method('getSubClients')
99
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
100 100
 
101 101
 		$object->copy();
102 102
 	}
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 
105 105
 	public function testDelete()
106 106
 	{
107
-		$this->assertNotNull( $this->object->delete() );
107
+		$this->assertNotNull($this->object->delete());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testDeleteException()
112 112
 	{
113
-		$object = $this->getClientMock( 'getSubClients' );
113
+		$object = $this->getClientMock('getSubClients');
114 114
 
115
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
116
-			->will( $this->throwException( new \RuntimeException() ) );
115
+		$object->expects($this->exactly(2))->method('getSubClients')
116
+			->will($this->throwException(new \RuntimeException()));
117 117
 
118 118
 		$object->delete();
119 119
 	}
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
 	public function testDeleteMShopException()
123 123
 	{
124
-		$object = $this->getClientMock( 'getSubClients' );
124
+		$object = $this->getClientMock('getSubClients');
125 125
 
126
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
127
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
126
+		$object->expects($this->exactly(2))->method('getSubClients')
127
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
128 128
 
129 129
 		$object->delete();
130 130
 	}
@@ -132,24 +132,24 @@  discard block
 block discarded – undo
132 132
 
133 133
 	public function testGet()
134 134
 	{
135
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' );
135
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'service');
136 136
 
137
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unitpaymentcode' )->getId()];
138
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
139
-		$this->view->addHelper( 'param', $helper );
137
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unitpaymentcode')->getId()];
138
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
139
+		$this->view->addHelper('param', $helper);
140 140
 
141 141
 		$result = $this->object->get();
142 142
 
143
-		$this->assertContains( 'unitpaymentlabel', $result );
143
+		$this->assertContains('unitpaymentlabel', $result);
144 144
 	}
145 145
 
146 146
 
147 147
 	public function testGetException()
148 148
 	{
149
-		$object = $this->getClientMock( 'getSubClients' );
149
+		$object = $this->getClientMock('getSubClients');
150 150
 
151
-		$object->expects( $this->once() )->method( 'getSubClients' )
152
-			->will( $this->throwException( new \RuntimeException() ) );
151
+		$object->expects($this->once())->method('getSubClients')
152
+			->will($this->throwException(new \RuntimeException()));
153 153
 
154 154
 		$object->get();
155 155
 	}
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
 
158 158
 	public function testGetMShopException()
159 159
 	{
160
-		$object = $this->getClientMock( 'getSubClients' );
160
+		$object = $this->getClientMock('getSubClients');
161 161
 
162
-		$object->expects( $this->once() )->method( 'getSubClients' )
163
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
162
+		$object->expects($this->once())->method('getSubClients')
163
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
164 164
 
165 165
 		$object->get();
166 166
 	}
@@ -168,23 +168,23 @@  discard block
 block discarded – undo
168 168
 
169 169
 	public function testGetViewException()
170 170
 	{
171
-		$object = new \Aimeos\Admin\JQAdm\Service\Standard( $this->context, [] );
171
+		$object = new \Aimeos\Admin\JQAdm\Service\Standard($this->context, []);
172 172
 
173
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
173
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
174 174
 		$object->getView();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSave()
179 179
 	{
180
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' );
181
-		$typeManager = \Aimeos\MShop\Factory::createManager( $this->context, 'service/type' );
180
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'service');
181
+		$typeManager = \Aimeos\MShop\Factory::createManager($this->context, 'service/type');
182 182
 
183 183
 		$param = array(
184 184
 			'site' => 'unittest',
185 185
 			'item' => array(
186 186
 				'service.id' => '',
187
-				'service.typeid' => $typeManager->findItem( 'delivery', [], 'service' )->getId(),
187
+				'service.typeid' => $typeManager->findItem('delivery', [], 'service')->getId(),
188 188
 				'service.code' => 'test',
189 189
 				'service.provider' => 'Example',
190 190
 				'service.label' => 'test label',
@@ -192,27 +192,27 @@  discard block
 block discarded – undo
192 192
 				'service.dateend' => null,
193 193
 				'service.position' => '2',
194 194
 				'config' => array(
195
-					'key' => array( 0 => 'test key' ),
196
-					'val' => array( 0 => 'test value' ),
195
+					'key' => array(0 => 'test key'),
196
+					'val' => array(0 => 'test value'),
197 197
 				),
198 198
 			),
199 199
 		);
200 200
 
201
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
202
-		$this->view->addHelper( 'param', $helper );
201
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
202
+		$this->view->addHelper('param', $helper);
203 203
 
204 204
 		$this->object->save();
205 205
 
206
-		$manager->deleteItem( $manager->findItem( 'test' )->getId() );
206
+		$manager->deleteItem($manager->findItem('test')->getId());
207 207
 	}
208 208
 
209 209
 
210 210
 	public function testSaveException()
211 211
 	{
212
-		$object = $this->getClientMock( 'fromArray' );
212
+		$object = $this->getClientMock('fromArray');
213 213
 
214
-		$object->expects( $this->once() )->method( 'fromArray' )
215
-			->will( $this->throwException( new \RuntimeException() ) );
214
+		$object->expects($this->once())->method('fromArray')
215
+			->will($this->throwException(new \RuntimeException()));
216 216
 
217 217
 		$object->save();
218 218
 	}
@@ -220,10 +220,10 @@  discard block
 block discarded – undo
220 220
 
221 221
 	public function testSaveMShopException()
222 222
 	{
223
-		$object = $this->getClientMock( 'fromArray' );
223
+		$object = $this->getClientMock('fromArray');
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 228
 		$object->save();
229 229
 	}
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
 
232 232
 	public function testSaveJQAdmException()
233 233
 	{
234
-		$object = $this->getClientMock( 'fromArray' );
234
+		$object = $this->getClientMock('fromArray');
235 235
 
236
-		$object->expects( $this->once() )->method( 'fromArray' )
237
-			->will( $this->throwException( new \RuntimeException() ) );
236
+		$object->expects($this->once())->method('fromArray')
237
+			->will($this->throwException(new \RuntimeException()));
238 238
 
239 239
 		$object->save();
240 240
 	}
@@ -245,27 +245,27 @@  discard block
 block discarded – undo
245 245
 		$param = array(
246 246
 			'site' => 'unittest', 'lang' => 'de',
247 247
 			'filter' => array(
248
-				'key' => array( 0 => 'service.code' ),
249
-				'op' => array( 0 => '==' ),
250
-				'val' => array( 0 => 'unitpaymentcode' ),
248
+				'key' => array(0 => 'service.code'),
249
+				'op' => array(0 => '=='),
250
+				'val' => array(0 => 'unitpaymentcode'),
251 251
 			),
252
-			'sort' => array( 'service.label', '-service.id' ),
252
+			'sort' => array('service.label', '-service.id'),
253 253
 		);
254
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
255
-		$this->view->addHelper( 'param', $helper );
254
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
255
+		$this->view->addHelper('param', $helper);
256 256
 
257 257
 		$result = $this->object->search();
258 258
 
259
-		$this->assertContains( '>unitpaymentlabel<', $result );
259
+		$this->assertContains('>unitpaymentlabel<', $result);
260 260
 	}
261 261
 
262 262
 
263 263
 	public function testSearchException()
264 264
 	{
265
-		$object = $this->getClientMock( 'initCriteria' );
265
+		$object = $this->getClientMock('initCriteria');
266 266
 
267
-		$object->expects( $this->once() )->method( 'initCriteria' )
268
-			->will( $this->throwException( new \RuntimeException() ) );
267
+		$object->expects($this->once())->method('initCriteria')
268
+			->will($this->throwException(new \RuntimeException()));
269 269
 
270 270
 		$object->search();
271 271
 	}
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
 
274 274
 	public function testSearchMShopException()
275 275
 	{
276
-		$object = $this->getClientMock( 'initCriteria' );
276
+		$object = $this->getClientMock('initCriteria');
277 277
 
278
-		$object->expects( $this->once() )->method( 'initCriteria' )
279
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
278
+		$object->expects($this->once())->method('initCriteria')
279
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
280 280
 
281 281
 		$object->search();
282 282
 	}
@@ -284,34 +284,34 @@  discard block
 block discarded – undo
284 284
 
285 285
 	public function testGetSubClient()
286 286
 	{
287
-		$result = $this->object->getSubClient( 'image' );
288
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
287
+		$result = $this->object->getSubClient('image');
288
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
289 289
 	}
290 290
 
291 291
 
292 292
 	public function testGetSubClientInvalid()
293 293
 	{
294
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
295
-		$this->object->getSubClient( '$unknown$' );
294
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
295
+		$this->object->getSubClient('$unknown$');
296 296
 	}
297 297
 
298 298
 
299 299
 	public function testGetSubClientUnknown()
300 300
 	{
301
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
302
-		$this->object->getSubClient( 'unknown' );
301
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
302
+		$this->object->getSubClient('unknown');
303 303
 	}
304 304
 
305 305
 
306
-	public function getClientMock( $method )
306
+	public function getClientMock($method)
307 307
 	{
308
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Service\Standard' )
309
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
310
-			->setMethods( [$method] )
308
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Service\Standard')
309
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
310
+			->setMethods([$method])
311 311
 			->getMock();
312 312
 
313
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
314
-		$object->setView( $this->getViewNoRender() );
313
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
314
+		$object->setView($this->getViewNoRender());
315 315
 
316 316
 		return $object;
317 317
 	}
@@ -319,19 +319,19 @@  discard block
 block discarded – undo
319 319
 
320 320
 	protected function getViewNoRender()
321 321
 	{
322
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
323
-			->setConstructorArgs( array( [] ) )
324
-			->setMethods( array( 'render', 'config' ) )
322
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
323
+			->setConstructorArgs(array([]))
324
+			->setMethods(array('render', 'config'))
325 325
 			->getMock();
326 326
 
327
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' );
327
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'service');
328 328
 
329
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unitpaymentcode' )->getId()];
330
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
331
-		$view->addHelper( 'param', $helper );
329
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unitpaymentcode')->getId()];
330
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
331
+		$view->addHelper('param', $helper);
332 332
 
333
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
334
-		$view->addHelper( 'access', $helper );
333
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
334
+		$view->addHelper('access', $helper);
335 335
 
336 336
 		return $view;
337 337
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Supplier/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -291,6 +291,9 @@
 block discarded – undo
291 291
 	}
292 292
 
293 293
 
294
+	/**
295
+	 * @param string $method
296
+	 */
294 297
 	public function getClientMock( $method )
295 298
 	{
296 299
 		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Supplier\Standard' )
Please login to merge, or discard this patch.
Spacing   +89 added lines, -89 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\Supplier\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\Supplier\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,24 +64,24 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function testCopy()
66 66
 	{
67
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'supplier' );
67
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'supplier');
68 68
 
69
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unitCode001' )->getId()];
70
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
71
-		$this->view->addHelper( 'param', $helper );
69
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unitCode001')->getId()];
70
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
71
+		$this->view->addHelper('param', $helper);
72 72
 
73 73
 		$result = $this->object->copy();
74 74
 
75
-		$this->assertContains( 'unitSupplier001', $result );
75
+		$this->assertContains('unitSupplier001', $result);
76 76
 	}
77 77
 
78 78
 
79 79
 	public function testCopyException()
80 80
 	{
81
-		$object = $this->getClientMock( 'getSubClients' );
81
+		$object = $this->getClientMock('getSubClients');
82 82
 
83
-		$object->expects( $this->once() )->method( 'getSubClients' )
84
-			->will( $this->throwException( new \RuntimeException() ) );
83
+		$object->expects($this->once())->method('getSubClients')
84
+			->will($this->throwException(new \RuntimeException()));
85 85
 
86 86
 		$object->copy();
87 87
 	}
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 
90 90
 	public function testCopyMShopException()
91 91
 	{
92
-		$object = $this->getClientMock( 'getSubClients' );
92
+		$object = $this->getClientMock('getSubClients');
93 93
 
94
-		$object->expects( $this->once() )->method( 'getSubClients' )
95
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
94
+		$object->expects($this->once())->method('getSubClients')
95
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
96 96
 
97 97
 		$object->copy();
98 98
 	}
@@ -100,16 +100,16 @@  discard block
 block discarded – undo
100 100
 
101 101
 	public function testDelete()
102 102
 	{
103
-		$this->assertNotNull( $this->object->delete() );
103
+		$this->assertNotNull($this->object->delete());
104 104
 	}
105 105
 
106 106
 
107 107
 	public function testDeleteException()
108 108
 	{
109
-		$object = $this->getClientMock( 'getSubClients' );
109
+		$object = $this->getClientMock('getSubClients');
110 110
 
111
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
112
-			->will( $this->throwException( new \RuntimeException() ) );
111
+		$object->expects($this->exactly(2))->method('getSubClients')
112
+			->will($this->throwException(new \RuntimeException()));
113 113
 
114 114
 		$object->delete();
115 115
 	}
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
 
118 118
 	public function testDeleteMShopException()
119 119
 	{
120
-		$object = $this->getClientMock( 'getSubClients' );
120
+		$object = $this->getClientMock('getSubClients');
121 121
 
122
-		$object->expects( $this->exactly( 2 ) )->method( 'getSubClients' )
123
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
122
+		$object->expects($this->exactly(2))->method('getSubClients')
123
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
124 124
 
125 125
 		$object->delete();
126 126
 	}
@@ -128,24 +128,24 @@  discard block
 block discarded – undo
128 128
 
129 129
 	public function testGet()
130 130
 	{
131
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'supplier' );
131
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'supplier');
132 132
 
133
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unitCode001' )->getId()];
134
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
135
-		$this->view->addHelper( 'param', $helper );
133
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unitCode001')->getId()];
134
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
135
+		$this->view->addHelper('param', $helper);
136 136
 
137 137
 		$result = $this->object->get();
138 138
 
139
-		$this->assertContains( 'unitSupplier001', $result );
139
+		$this->assertContains('unitSupplier001', $result);
140 140
 	}
141 141
 
142 142
 
143 143
 	public function testGetException()
144 144
 	{
145
-		$object = $this->getClientMock( 'getSubClients' );
145
+		$object = $this->getClientMock('getSubClients');
146 146
 
147
-		$object->expects( $this->once() )->method( 'getSubClients' )
148
-			->will( $this->throwException( new \RuntimeException() ) );
147
+		$object->expects($this->once())->method('getSubClients')
148
+			->will($this->throwException(new \RuntimeException()));
149 149
 
150 150
 		$object->get();
151 151
 	}
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
 
154 154
 	public function testGetMShopException()
155 155
 	{
156
-		$object = $this->getClientMock( 'getSubClients' );
156
+		$object = $this->getClientMock('getSubClients');
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 161
 		$object->get();
162 162
 	}
@@ -164,16 +164,16 @@  discard block
 block discarded – undo
164 164
 
165 165
 	public function testGetViewException()
166 166
 	{
167
-		$object = new \Aimeos\Admin\JQAdm\Supplier\Standard( $this->context, [] );
167
+		$object = new \Aimeos\Admin\JQAdm\Supplier\Standard($this->context, []);
168 168
 
169
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
169
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
170 170
 		$object->getView();
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testSave()
175 175
 	{
176
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'supplier' );
176
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'supplier');
177 177
 
178 178
 		$param = array(
179 179
 			'site' => 'unittest',
@@ -185,21 +185,21 @@  discard block
 block discarded – undo
185 185
 			),
186 186
 		);
187 187
 
188
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
189
-		$this->view->addHelper( 'param', $helper );
188
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
189
+		$this->view->addHelper('param', $helper);
190 190
 
191 191
 		$this->object->save();
192 192
 
193
-		$manager->deleteItem( $manager->findItem( 'jqadm@test' )->getId() );
193
+		$manager->deleteItem($manager->findItem('jqadm@test')->getId());
194 194
 	}
195 195
 
196 196
 
197 197
 	public function testSaveException()
198 198
 	{
199
-		$object = $this->getClientMock( 'fromArray' );
199
+		$object = $this->getClientMock('fromArray');
200 200
 
201
-		$object->expects( $this->once() )->method( 'fromArray' )
202
-			->will( $this->throwException( new \RuntimeException() ) );
201
+		$object->expects($this->once())->method('fromArray')
202
+			->will($this->throwException(new \RuntimeException()));
203 203
 
204 204
 		$object->save();
205 205
 	}
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
 
208 208
 	public function testSaveMShopException()
209 209
 	{
210
-		$object = $this->getClientMock( 'fromArray' );
210
+		$object = $this->getClientMock('fromArray');
211 211
 
212
-		$object->expects( $this->once() )->method( 'fromArray' )
213
-			->will( $this->throwException( new \RuntimeException() ) );
212
+		$object->expects($this->once())->method('fromArray')
213
+			->will($this->throwException(new \RuntimeException()));
214 214
 
215 215
 		$object->save();
216 216
 	}
@@ -218,10 +218,10 @@  discard block
 block discarded – undo
218 218
 
219 219
 	public function testSaveJQAdmException()
220 220
 	{
221
-		$object = $this->getClientMock( 'fromArray' );
221
+		$object = $this->getClientMock('fromArray');
222 222
 
223
-		$object->expects( $this->once() )->method( 'fromArray' )
224
-			->will( $this->throwException( new \RuntimeException() ) );
223
+		$object->expects($this->once())->method('fromArray')
224
+			->will($this->throwException(new \RuntimeException()));
225 225
 
226 226
 		$object->save();
227 227
 	}
@@ -232,27 +232,27 @@  discard block
 block discarded – undo
232 232
 		$param = array(
233 233
 			'site' => 'unittest', 'lang' => 'de',
234 234
 			'filter' => array(
235
-				'key' => array( 0 => 'supplier.code' ),
236
-				'op' => array( 0 => '==' ),
237
-				'val' => array( 0 => 'unitCode001' ),
235
+				'key' => array(0 => 'supplier.code'),
236
+				'op' => array(0 => '=='),
237
+				'val' => array(0 => 'unitCode001'),
238 238
 			),
239
-			'sort' => array( 'supplier.label', '-supplier.id' ),
239
+			'sort' => array('supplier.label', '-supplier.id'),
240 240
 		);
241
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
242
-		$this->view->addHelper( 'param', $helper );
241
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
242
+		$this->view->addHelper('param', $helper);
243 243
 
244 244
 		$result = $this->object->search();
245 245
 
246
-		$this->assertContains( '>unitCode001<', $result );
246
+		$this->assertContains('>unitCode001<', $result);
247 247
 	}
248 248
 
249 249
 
250 250
 	public function testSearchException()
251 251
 	{
252
-		$object = $this->getClientMock( 'initCriteria' );
252
+		$object = $this->getClientMock('initCriteria');
253 253
 
254
-		$object->expects( $this->once() )->method( 'initCriteria' )
255
-			->will( $this->throwException( new \RuntimeException() ) );
254
+		$object->expects($this->once())->method('initCriteria')
255
+			->will($this->throwException(new \RuntimeException()));
256 256
 
257 257
 		$object->search();
258 258
 	}
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 
261 261
 	public function testSearchMShopException()
262 262
 	{
263
-		$object = $this->getClientMock( 'initCriteria' );
263
+		$object = $this->getClientMock('initCriteria');
264 264
 
265
-		$object->expects( $this->once() )->method( 'initCriteria' )
266
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
265
+		$object->expects($this->once())->method('initCriteria')
266
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
267 267
 
268 268
 		$object->search();
269 269
 	}
@@ -271,34 +271,34 @@  discard block
 block discarded – undo
271 271
 
272 272
 	public function testGetSubClient()
273 273
 	{
274
-		$result = $this->object->getSubClient( 'address' );
275
-		$this->assertInstanceOf( '\Aimeos\Admin\JQAdm\Iface', $result );
274
+		$result = $this->object->getSubClient('address');
275
+		$this->assertInstanceOf('\Aimeos\Admin\JQAdm\Iface', $result);
276 276
 	}
277 277
 
278 278
 
279 279
 	public function testGetSubClientInvalid()
280 280
 	{
281
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
282
-		$this->object->getSubClient( '$unknown$' );
281
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
282
+		$this->object->getSubClient('$unknown$');
283 283
 	}
284 284
 
285 285
 
286 286
 	public function testGetSubClientUnknown()
287 287
 	{
288
-		$this->setExpectedException( '\Aimeos\Admin\JQAdm\Exception' );
289
-		$this->object->getSubClient( 'unknown' );
288
+		$this->setExpectedException('\Aimeos\Admin\JQAdm\Exception');
289
+		$this->object->getSubClient('unknown');
290 290
 	}
291 291
 
292 292
 
293
-	public function getClientMock( $method )
293
+	public function getClientMock($method)
294 294
 	{
295
-		$object = $this->getMockBuilder( '\Aimeos\Admin\JQAdm\Supplier\Standard' )
296
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
297
-			->setMethods( [$method] )
295
+		$object = $this->getMockBuilder('\Aimeos\Admin\JQAdm\Supplier\Standard')
296
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
297
+			->setMethods([$method])
298 298
 			->getMock();
299 299
 
300
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
301
-		$object->setView( $this->getViewNoRender() );
300
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
301
+		$object->setView($this->getViewNoRender());
302 302
 
303 303
 		return $object;
304 304
 	}
@@ -306,19 +306,19 @@  discard block
 block discarded – undo
306 306
 
307 307
 	protected function getViewNoRender()
308 308
 	{
309
-		$view = $this->getMockBuilder( '\Aimeos\MW\View\Standard' )
310
-			->setConstructorArgs( array( [] ) )
311
-			->setMethods( array( 'render', 'config' ) )
309
+		$view = $this->getMockBuilder('\Aimeos\MW\View\Standard')
310
+			->setConstructorArgs(array([]))
311
+			->setMethods(array('render', 'config'))
312 312
 			->getMock();
313 313
 
314
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'supplier' );
314
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'supplier');
315 315
 
316
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unitCode001' )->getId()];
317
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
318
-		$view->addHelper( 'param', $helper );
316
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unitCode001')->getId()];
317
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
318
+		$view->addHelper('param', $helper);
319 319
 
320
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
321
-		$view->addHelper( 'access', $helper );
320
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
321
+		$view->addHelper('access', $helper);
322 322
 
323 323
 		return $view;
324 324
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Order/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, '%order' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, '%order');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Order\Factory::createClient( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Order\Factory::createClient($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.