Completed
Push — master ( 521882...b49ab8 )
by Aimeos
04:07
created
admin/jqadm/tests/Admin/JQAdm/Locale/Currency/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -279,6 +279,9 @@
 block discarded – undo
279 279
 	}
280 280
 
281 281
 
282
+	/**
283
+	 * @param string $method
284
+	 */
282 285
 	public function getClientMock( $method )
283 286
 	{
284 287
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Currency\Standard::class )
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::class );
163
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
164 164
 		$object->getView();
165 165
 	}
166 166
 
167 167
 
168 168
 	public function testSave()
169 169
 	{
170
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/currency' );
170
+		$manager = \Aimeos\MShop::create($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::class );
271
-		$this->object->getSubClient( '$unknown$' );
270
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class );
278
-		$this->object->getSubClient( 'unknown' );
277
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class )
285
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
286
-			->setMethods( [$method] )
284
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Currency\Standard::class)
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::class )
299
-			->setConstructorArgs( array( [] ) )
300
-			->setMethods( array( 'render', 'config' ) )
298
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
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
@@ -279,6 +279,9 @@
 block discarded – undo
279 279
 	}
280 280
 
281 281
 
282
+	/**
283
+	 * @param string $method
284
+	 */
282 285
 	public function getClientMock( $method )
283 286
 	{
284 287
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Language\Standard::class )
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::class );
163
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
164 164
 		$object->getView();
165 165
 	}
166 166
 
167 167
 
168 168
 	public function testSave()
169 169
 	{
170
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/language' );
170
+		$manager = \Aimeos\MShop::create($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::class );
271
-		$this->object->getSubClient( '$unknown$' );
270
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class );
278
-		$this->object->getSubClient( 'unknown' );
277
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class )
285
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
286
-			->setMethods( [$method] )
284
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Language\Standard::class)
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::class )
299
-			->setConstructorArgs( array( [] ) )
300
-			->setMethods( array( 'render', 'config' ) )
298
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
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
@@ -293,6 +293,9 @@
 block discarded – undo
293 293
 	}
294 294
 
295 295
 
296
+	/**
297
+	 * @param string $method
298
+	 */
296 299
 	public function getClientMock( $method )
297 300
 	{
298 301
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Locale\Site\Standard::class )
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::create( $this->context, 'locale/site' );
70
+		$manager = \Aimeos\MShop::create($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::create( $this->context, 'locale/site' );
134
+		$manager = \Aimeos\MShop::create($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::class );
172
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
173 173
 		$object->getView();
174 174
 	}
175 175
 
176 176
 
177 177
 	public function testSave()
178 178
 	{
179
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/site' );
179
+		$manager = \Aimeos\MShop::create($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::class );
285
-		$this->object->getSubClient( '$unknown$' );
284
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class );
292
-		$this->object->getSubClient( 'unknown' );
291
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class )
299
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
300
-			->setMethods( [$method] )
298
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Locale\Site\Standard::class)
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::class )
313
-			->setConstructorArgs( array( [] ) )
314
-			->setMethods( array( 'render', 'config' ) )
312
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
313
+			->setConstructorArgs(array([]))
314
+			->setMethods(array('render', 'config'))
315 315
 			->getMock();
316 316
 
317
-		$manager = \Aimeos\MShop::create( $this->context, 'locale/site' );
317
+		$manager = \Aimeos\MShop::create($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/Order/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -305,6 +305,9 @@
 block discarded – undo
305 305
 	}
306 306
 
307 307
 
308
+	/**
309
+	 * @param string $method
310
+	 */
308 311
 	public function getClientMock( $method )
309 312
 	{
310 313
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Order\Standard::class )
Please login to merge, or discard this patch.
Spacing   +95 added lines, -95 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::class )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\Order\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\Order\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
 	}
@@ -69,21 +69,21 @@  discard block
 block discarded – undo
69 69
 	public function testCopy()
70 70
 	{
71 71
 		$param = ['site' => 'unittest', 'id' => $this->getOrderBaseItem()->getId()];
72
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
73
-		$this->view->addHelper( 'param', $helper );
72
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
73
+		$this->view->addHelper('param', $helper);
74 74
 
75 75
 		$result = $this->object->copy();
76 76
 
77
-		$this->assertContains( 'This is another comment.', $result );
77
+		$this->assertContains('This is another comment.', $result);
78 78
 	}
79 79
 
80 80
 
81 81
 	public function testCopyException()
82 82
 	{
83
-		$object = $this->getClientMock( 'getSubClients' );
83
+		$object = $this->getClientMock('getSubClients');
84 84
 
85
-		$object->expects( $this->once() )->method( 'getSubClients' )
86
-			->will( $this->throwException( new \RuntimeException() ) );
85
+		$object->expects($this->once())->method('getSubClients')
86
+			->will($this->throwException(new \RuntimeException()));
87 87
 
88 88
 		$object->copy();
89 89
 	}
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 
92 92
 	public function testCopyMShopException()
93 93
 	{
94
-		$object = $this->getClientMock( 'getSubClients' );
94
+		$object = $this->getClientMock('getSubClients');
95 95
 
96
-		$object->expects( $this->once() )->method( 'getSubClients' )
97
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
96
+		$object->expects($this->once())->method('getSubClients')
97
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
98 98
 
99 99
 		$object->copy();
100 100
 	}
@@ -102,28 +102,28 @@  discard block
 block discarded – undo
102 102
 
103 103
 	public function testDelete()
104 104
 	{
105
-		$this->assertNull( $this->object->delete() );
105
+		$this->assertNull($this->object->delete());
106 106
 	}
107 107
 
108 108
 
109 109
 	public function testGet()
110 110
 	{
111 111
 		$param = ['site' => 'unittest', 'id' => $this->getOrderBaseItem()->getId()];
112
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
113
-		$this->view->addHelper( 'param', $helper );
112
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
113
+		$this->view->addHelper('param', $helper);
114 114
 
115 115
 		$result = $this->object->get();
116 116
 
117
-		$this->assertContains( 'This is another comment.', $result );
117
+		$this->assertContains('This is another comment.', $result);
118 118
 	}
119 119
 
120 120
 
121 121
 	public function testGetException()
122 122
 	{
123
-		$object = $this->getClientMock( 'getSubClients' );
123
+		$object = $this->getClientMock('getSubClients');
124 124
 
125
-		$object->expects( $this->once() )->method( 'getSubClients' )
126
-			->will( $this->throwException( new \RuntimeException() ) );
125
+		$object->expects($this->once())->method('getSubClients')
126
+			->will($this->throwException(new \RuntimeException()));
127 127
 
128 128
 		$object->get();
129 129
 	}
@@ -131,10 +131,10 @@  discard block
 block discarded – undo
131 131
 
132 132
 	public function testGetMShopException()
133 133
 	{
134
-		$object = $this->getClientMock( 'getSubClients' );
134
+		$object = $this->getClientMock('getSubClients');
135 135
 
136
-		$object->expects( $this->once() )->method( 'getSubClients' )
137
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
136
+		$object->expects($this->once())->method('getSubClients')
137
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
138 138
 
139 139
 		$object->get();
140 140
 	}
@@ -150,28 +150,28 @@  discard block
 block discarded – undo
150 150
 			],
151 151
 			'sort' => ['-order.ctime', 'order.id'],
152 152
 		];
153
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
154
-		$this->view->addHelper( 'param', $helper );
153
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
154
+		$this->view->addHelper('param', $helper);
155 155
 
156 156
 		$result = $this->object->export();
157 157
 
158
-		$mq = $this->context->getMessageQueueManager()->get( 'mq-admin' )->getQueue( 'order-export' );
158
+		$mq = $this->context->getMessageQueueManager()->get('mq-admin')->getQueue('order-export');
159 159
 
160 160
 		$msg = $mq->get();
161
-		$this->assertNotNull( $msg );
162
-		$mq->del( $msg );
161
+		$this->assertNotNull($msg);
162
+		$mq->del($msg);
163 163
 
164 164
 		$expected = '{"sitecode":"unittest","filter":{"&&":[{"==":{"order.id":"1"}}]},"sort":{"order.ctime":"-","order.id":"+"}}';
165
-		$this->assertEquals( $expected, $msg->getBody() );
165
+		$this->assertEquals($expected, $msg->getBody());
166 166
 	}
167 167
 
168 168
 
169 169
 	public function testExportException()
170 170
 	{
171
-		$object = $this->getClientMock( 'storeSearchParams' );
171
+		$object = $this->getClientMock('storeSearchParams');
172 172
 
173
-		$object->expects( $this->atLeastOnce() )->method( 'storeSearchParams' )
174
-			->will( $this->throwException( new \RuntimeException() ) );
173
+		$object->expects($this->atLeastOnce())->method('storeSearchParams')
174
+			->will($this->throwException(new \RuntimeException()));
175 175
 
176 176
 		$object->export();
177 177
 	}
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
 
180 180
 	public function testExportMShopException()
181 181
 	{
182
-		$object = $this->getClientMock( 'storeSearchParams' );
182
+		$object = $this->getClientMock('storeSearchParams');
183 183
 
184
-		$object->expects( $this->atLeastOnce() )->method( 'storeSearchParams' )
185
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
184
+		$object->expects($this->atLeastOnce())->method('storeSearchParams')
185
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
186 186
 
187 187
 		$object->export();
188 188
 	}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 	public function testSave()
192 192
 	{
193
-		$manager = \Aimeos\MShop::create( $this->context, 'order/base' );
193
+		$manager = \Aimeos\MShop::create($this->context, 'order/base');
194 194
 		$this->view->item = $manager->createItem();
195 195
 
196 196
 		$param = array(
@@ -200,21 +200,21 @@  discard block
 block discarded – undo
200 200
 			),
201 201
 		);
202 202
 
203
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
204
-		$this->view->addHelper( 'param', $helper );
203
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
204
+		$this->view->addHelper('param', $helper);
205 205
 
206 206
 		$this->object->save();
207 207
 
208
-		$manager->deleteItem( $this->getOrderBaseItem( 'jqadm test comment' )->getId() );
208
+		$manager->deleteItem($this->getOrderBaseItem('jqadm test comment')->getId());
209 209
 	}
210 210
 
211 211
 
212 212
 	public function testSaveException()
213 213
 	{
214
-		$object = $this->getClientMock( 'fromArray' );
214
+		$object = $this->getClientMock('fromArray');
215 215
 
216
-		$object->expects( $this->once() )->method( 'fromArray' )
217
-			->will( $this->throwException( new \RuntimeException() ) );
216
+		$object->expects($this->once())->method('fromArray')
217
+			->will($this->throwException(new \RuntimeException()));
218 218
 
219 219
 		$object->save();
220 220
 	}
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
 
223 223
 	public function testSaveMShopException()
224 224
 	{
225
-		$object = $this->getClientMock( 'fromArray' );
225
+		$object = $this->getClientMock('fromArray');
226 226
 
227
-		$object->expects( $this->once() )->method( 'fromArray' )
228
-			->will( $this->throwException( new \RuntimeException() ) );
227
+		$object->expects($this->once())->method('fromArray')
228
+			->will($this->throwException(new \RuntimeException()));
229 229
 
230 230
 		$object->save();
231 231
 	}
@@ -233,10 +233,10 @@  discard block
 block discarded – undo
233 233
 
234 234
 	public function testSaveJQAdmException()
235 235
 	{
236
-		$object = $this->getClientMock( 'fromArray' );
236
+		$object = $this->getClientMock('fromArray');
237 237
 
238
-		$object->expects( $this->once() )->method( 'fromArray' )
239
-			->will( $this->throwException( new \RuntimeException() ) );
238
+		$object->expects($this->once())->method('fromArray')
239
+			->will($this->throwException(new \RuntimeException()));
240 240
 
241 241
 		$object->save();
242 242
 	}
@@ -247,14 +247,14 @@  discard block
 block discarded – undo
247 247
 		$param = array(
248 248
 			'site' => 'unittest', 'lang' => 'de',
249 249
 			'filter' => array(
250
-				'key' => array( 0 => 'order.base.type' ),
251
-				'op' => array( 0 => '==' ),
252
-				'val' => array( 0 => 'web' ),
250
+				'key' => array(0 => 'order.base.type'),
251
+				'op' => array(0 => '=='),
252
+				'val' => array(0 => 'web'),
253 253
 			),
254
-			'sort' => array( '-order.base.id' ),
254
+			'sort' => array('-order.base.id'),
255 255
 		);
256
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
257
-		$this->view->addHelper( 'param', $helper );
256
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
257
+		$this->view->addHelper('param', $helper);
258 258
 
259 259
 		$result = $this->object->search();
260 260
 
@@ -264,10 +264,10 @@  discard block
 block discarded – undo
264 264
 
265 265
 	public function testSearchException()
266 266
 	{
267
-		$object = $this->getClientMock( 'initCriteria' );
267
+		$object = $this->getClientMock('initCriteria');
268 268
 
269
-		$object->expects( $this->once() )->method( 'initCriteria' )
270
-			->will( $this->throwException( new \RuntimeException() ) );
269
+		$object->expects($this->once())->method('initCriteria')
270
+			->will($this->throwException(new \RuntimeException()));
271 271
 
272 272
 		$object->search();
273 273
 	}
@@ -275,10 +275,10 @@  discard block
 block discarded – undo
275 275
 
276 276
 	public function testSearchMShopException()
277 277
 	{
278
-		$object = $this->getClientMock( 'initCriteria' );
278
+		$object = $this->getClientMock('initCriteria');
279 279
 
280
-		$object->expects( $this->once() )->method( 'initCriteria' )
281
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
280
+		$object->expects($this->once())->method('initCriteria')
281
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
282 282
 
283 283
 		$object->search();
284 284
 	}
@@ -286,34 +286,34 @@  discard block
 block discarded – undo
286 286
 
287 287
 	public function testGetSubClient()
288 288
 	{
289
-		$result = $this->object->getSubClient( 'invoice' );
290
-		$this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result );
289
+		$result = $this->object->getSubClient('invoice');
290
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
291 291
 	}
292 292
 
293 293
 
294 294
 	public function testGetSubClientInvalid()
295 295
 	{
296
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
297
-		$this->object->getSubClient( '$unknown$' );
296
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
297
+		$this->object->getSubClient('$unknown$');
298 298
 	}
299 299
 
300 300
 
301 301
 	public function testGetSubClientUnknown()
302 302
 	{
303
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
304
-		$this->object->getSubClient( 'unknown' );
303
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
304
+		$this->object->getSubClient('unknown');
305 305
 	}
306 306
 
307 307
 
308
-	public function getClientMock( $method )
308
+	public function getClientMock($method)
309 309
 	{
310
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Order\Standard::class )
311
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
312
-			->setMethods( [$method] )
310
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Order\Standard::class)
311
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
312
+			->setMethods([$method])
313 313
 			->getMock();
314 314
 
315
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
316
-		$object->setView( $this->getViewNoRender() );
315
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
316
+		$object->setView($this->getViewNoRender());
317 317
 
318 318
 		return $object;
319 319
 	}
@@ -321,33 +321,33 @@  discard block
 block discarded – undo
321 321
 
322 322
 	protected function getViewNoRender()
323 323
 	{
324
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
325
-			->setConstructorArgs( array( [] ) )
326
-			->setMethods( array( 'render', 'config' ) )
324
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
325
+			->setConstructorArgs(array([]))
326
+			->setMethods(array('render', 'config'))
327 327
 			->getMock();
328 328
 
329 329
 		$param = ['site' => 'unittest', 'id' => $this->getOrderBaseItem()->getId()];
330
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
331
-		$view->addHelper( 'param', $helper );
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
 	}
338 338
 
339 339
 
340
-	protected function getOrderBaseItem( $comment = 'This is another comment.' )
340
+	protected function getOrderBaseItem($comment = 'This is another comment.')
341 341
 	{
342
-		$manager = \Aimeos\MShop::create( $this->context, 'order/base' );
342
+		$manager = \Aimeos\MShop::create($this->context, 'order/base');
343 343
 
344 344
 		$search = $manager->createSearch();
345
-		$search->setConditions( $search->compare( '==', 'order.base.comment', $comment ) );
345
+		$search->setConditions($search->compare('==', 'order.base.comment', $comment));
346 346
 
347
-		$items = $manager->searchItems( $search );
347
+		$items = $manager->searchItems($search);
348 348
 
349
-		if( ( $item = reset( $items ) ) === false ) {
350
-			throw new \RuntimeException( 'No order base item found' );
349
+		if (($item = reset($items)) === false) {
350
+			throw new \RuntimeException('No order base item found');
351 351
 		}
352 352
 
353 353
 		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
@@ -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\Plugin\Standard::class )
Please login to merge, or discard this patch.
Spacing   +90 added lines, -90 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,16 +160,16 @@  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::class );
165
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
166 166
 		$object->getView();
167 167
 	}
168 168
 
169 169
 
170 170
 	public function testSave()
171 171
 	{
172
-		$manager = \Aimeos\MShop::create( $this->context, 'plugin' );
172
+		$manager = \Aimeos\MShop::create($this->context, 'plugin');
173 173
 
174 174
 		$param = array(
175 175
 			'site' => 'unittest',
@@ -180,27 +180,27 @@  discard block
 block discarded – undo
180 180
 				'plugin.label' => 'test label',
181 181
 				'plugin.position' => '2',
182 182
 				'config' => array(
183
-					'key' => array( 0 => 'test key' ),
184
-					'val' => array( 0 => 'test value' ),
183
+					'key' => array(0 => 'test key'),
184
+					'val' => array(0 => 'test value'),
185 185
 				),
186 186
 			),
187 187
 		);
188 188
 
189
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
190
-		$this->view->addHelper( 'param', $helper );
189
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
190
+		$this->view->addHelper('param', $helper);
191 191
 
192 192
 		$this->object->save();
193 193
 
194
-		$manager->deleteItem( $this->getItem( 'test label' )->getId() );
194
+		$manager->deleteItem($this->getItem('test label')->getId());
195 195
 	}
196 196
 
197 197
 
198 198
 	public function testSaveException()
199 199
 	{
200
-		$object = $this->getClientMock( 'fromArray' );
200
+		$object = $this->getClientMock('fromArray');
201 201
 
202
-		$object->expects( $this->once() )->method( 'fromArray' )
203
-			->will( $this->throwException( new \RuntimeException() ) );
202
+		$object->expects($this->once())->method('fromArray')
203
+			->will($this->throwException(new \RuntimeException()));
204 204
 
205 205
 		$object->save();
206 206
 	}
@@ -208,10 +208,10 @@  discard block
 block discarded – undo
208 208
 
209 209
 	public function testSaveMShopException()
210 210
 	{
211
-		$object = $this->getClientMock( 'fromArray' );
211
+		$object = $this->getClientMock('fromArray');
212 212
 
213
-		$object->expects( $this->once() )->method( 'fromArray' )
214
-			->will( $this->throwException( new \RuntimeException() ) );
213
+		$object->expects($this->once())->method('fromArray')
214
+			->will($this->throwException(new \RuntimeException()));
215 215
 
216 216
 		$object->save();
217 217
 	}
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
 
220 220
 	public function testSaveJQAdmException()
221 221
 	{
222
-		$object = $this->getClientMock( 'fromArray' );
222
+		$object = $this->getClientMock('fromArray');
223 223
 
224
-		$object->expects( $this->once() )->method( 'fromArray' )
225
-			->will( $this->throwException( new \RuntimeException() ) );
224
+		$object->expects($this->once())->method('fromArray')
225
+			->will($this->throwException(new \RuntimeException()));
226 226
 
227 227
 		$object->save();
228 228
 	}
@@ -233,27 +233,27 @@  discard block
 block discarded – undo
233 233
 		$param = array(
234 234
 			'site' => 'unittest', 'lang' => 'de',
235 235
 			'filter' => array(
236
-				'key' => array( 0 => 'plugin.label' ),
237
-				'op' => array( 0 => '==' ),
238
-				'val' => array( 0 => 'Shipping-Plugin' ),
236
+				'key' => array(0 => 'plugin.label'),
237
+				'op' => array(0 => '=='),
238
+				'val' => array(0 => 'Shipping-Plugin'),
239 239
 			),
240
-			'sort' => array( 'plugin.label', '-plugin.id' ),
240
+			'sort' => array('plugin.label', '-plugin.id'),
241 241
 		);
242
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
243
-		$this->view->addHelper( 'param', $helper );
242
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
243
+		$this->view->addHelper('param', $helper);
244 244
 
245 245
 		$result = $this->object->search();
246 246
 
247
-		$this->assertContains( '>Shipping-Plugin<', $result );
247
+		$this->assertContains('>Shipping-Plugin<', $result);
248 248
 	}
249 249
 
250 250
 
251 251
 	public function testSearchException()
252 252
 	{
253
-		$object = $this->getClientMock( 'initCriteria' );
253
+		$object = $this->getClientMock('initCriteria');
254 254
 
255
-		$object->expects( $this->once() )->method( 'initCriteria' )
256
-			->will( $this->throwException( new \RuntimeException() ) );
255
+		$object->expects($this->once())->method('initCriteria')
256
+			->will($this->throwException(new \RuntimeException()));
257 257
 
258 258
 		$object->search();
259 259
 	}
@@ -261,10 +261,10 @@  discard block
 block discarded – undo
261 261
 
262 262
 	public function testSearchMShopException()
263 263
 	{
264
-		$object = $this->getClientMock( 'initCriteria' );
264
+		$object = $this->getClientMock('initCriteria');
265 265
 
266
-		$object->expects( $this->once() )->method( 'initCriteria' )
267
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
266
+		$object->expects($this->once())->method('initCriteria')
267
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
268 268
 
269 269
 		$object->search();
270 270
 	}
@@ -272,27 +272,27 @@  discard block
 block discarded – undo
272 272
 
273 273
 	public function testGetSubClientInvalid()
274 274
 	{
275
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
276
-		$this->object->getSubClient( '$unknown$' );
275
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
276
+		$this->object->getSubClient('$unknown$');
277 277
 	}
278 278
 
279 279
 
280 280
 	public function testGetSubClientUnknown()
281 281
 	{
282
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
283
-		$this->object->getSubClient( 'unknown' );
282
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
283
+		$this->object->getSubClient('unknown');
284 284
 	}
285 285
 
286 286
 
287
-	public function getClientMock( $method )
287
+	public function getClientMock($method)
288 288
 	{
289
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Plugin\Standard::class )
290
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
291
-			->setMethods( [$method] )
289
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Plugin\Standard::class)
290
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
291
+			->setMethods([$method])
292 292
 			->getMock();
293 293
 
294
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
295
-		$object->setView( $this->getViewNoRender() );
294
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
295
+		$object->setView($this->getViewNoRender());
296 296
 
297 297
 		return $object;
298 298
 	}
@@ -300,34 +300,34 @@  discard block
 block discarded – undo
300 300
 
301 301
 	protected function getViewNoRender()
302 302
 	{
303
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
304
-			->setConstructorArgs( array( [] ) )
305
-			->setMethods( array( 'render', 'config' ) )
303
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
304
+			->setConstructorArgs(array([]))
305
+			->setMethods(array('render', 'config'))
306 306
 			->getMock();
307 307
 
308 308
 		$param = ['site' => 'unittest', 'id' => $this->getItem()->getId()];
309
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
310
-		$view->addHelper( 'param', $helper );
309
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
310
+		$view->addHelper('param', $helper);
311 311
 
312
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
313
-		$view->addHelper( 'access', $helper );
312
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
313
+		$view->addHelper('access', $helper);
314 314
 
315 315
 		return $view;
316 316
 	}
317 317
 
318 318
 
319
-	protected function getItem( $label = 'Shipping-Plugin' )
319
+	protected function getItem($label = 'Shipping-Plugin')
320 320
 	{
321
-		$manager = \Aimeos\MShop::create( $this->context, 'plugin' );
321
+		$manager = \Aimeos\MShop::create($this->context, 'plugin');
322 322
 
323 323
 		$search = $manager->createSearch();
324
-		$search->setConditions( $search->compare( '==', 'plugin.label', $label ) );
325
-		$search->setSlice( 0, 1 );
324
+		$search->setConditions($search->compare('==', 'plugin.label', $label));
325
+		$search->setSlice(0, 1);
326 326
 
327
-		$items = $manager->searchItems( $search );
327
+		$items = $manager->searchItems($search);
328 328
 
329
-		if( ( $item = reset( $items ) ) === false ) {
330
-			throw new \Exception( sprintf( 'No plugin with label "%1$s" found', $label ) );
329
+		if (($item = reset($items)) === false) {
330
+			throw new \Exception(sprintf('No plugin with label "%1$s" found', $label));
331 331
 		}
332 332
 
333 333
 		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
@@ -321,6 +321,9 @@
 block discarded – undo
321 321
 	}
322 322
 
323 323
 
324
+	/**
325
+	 * @param string $method
326
+	 */
324 327
 	public function getClientMock( $method )
325 328
 	{
326 329
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Standard::class )
Please login to merge, or discard this patch.
Spacing   +100 added lines, -100 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::class )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\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::create( $this->context, 'product' );
71
+		$manager = \Aimeos\MShop::create($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::create( $this->context, 'product' );
135
+		$manager = \Aimeos\MShop::create($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,16 +168,16 @@  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::class );
173
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
174 174
 		$object->getView();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSave()
179 179
 	{
180
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
180
+		$manager = \Aimeos\MShop::create($this->context, 'product');
181 181
 
182 182
 		$param = array(
183 183
 			'site' => 'unittest',
@@ -189,27 +189,27 @@  discard block
 block discarded – undo
189 189
 				'product.datestart' => null,
190 190
 				'product.dateend' => null,
191 191
 				'config' => array(
192
-					'key' => array( 0 => 'test key' ),
193
-					'val' => array( 0 => 'test value' ),
192
+					'key' => array(0 => 'test key'),
193
+					'val' => array(0 => 'test value'),
194 194
 				),
195 195
 			),
196 196
 		);
197 197
 
198
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
199
-		$this->view->addHelper( 'param', $helper );
198
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
199
+		$this->view->addHelper('param', $helper);
200 200
 
201 201
 		$this->object->save();
202 202
 
203
-		$manager->deleteItem( $manager->findItem( 'test' )->getId() );
203
+		$manager->deleteItem($manager->findItem('test')->getId());
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 => 'product.code' ),
246
-				'op' => array( 0 => '==' ),
247
-				'val' => array( 0 => 'CNE' ),
245
+				'key' => array(0 => 'product.code'),
246
+				'op' => array(0 => '=='),
247
+				'val' => array(0 => 'CNE'),
248 248
 			),
249
-			'sort' => array( 'product.label', '-product.id' ),
249
+			'sort' => array('product.label', '-product.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( '>CNE<', $result );
256
+		$this->assertContains('>CNE<', $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,52 +281,52 @@  discard block
 block discarded – undo
281 281
 
282 282
 	public function testGetSubClient()
283 283
 	{
284
-		$result = $this->object->getSubClient( 'media' );
285
-		$this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result );
284
+		$result = $this->object->getSubClient('media');
285
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
286 286
 	}
287 287
 
288 288
 
289 289
 	public function testGetSubClientInvalid()
290 290
 	{
291
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
292
-		$this->object->getSubClient( '$unknown$' );
291
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
292
+		$this->object->getSubClient('$unknown$');
293 293
 	}
294 294
 
295 295
 
296 296
 	public function testGetSubClientUnknown()
297 297
 	{
298
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
299
-		$this->object->getSubClient( 'unknown' );
298
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
299
+		$this->object->getSubClient('unknown');
300 300
 	}
301 301
 
302 302
 
303 303
 	public function testGetSubClientDecorators()
304 304
 	{
305
-		$this->context->getConfig()->set( 'admin/jqadm/product/media/decorators/global', array( 'Cache' ) );
305
+		$this->context->getConfig()->set('admin/jqadm/product/media/decorators/global', array('Cache'));
306 306
 
307
-		$result = $this->object->getSubClient( 'media' );
308
-		$this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result );
307
+		$result = $this->object->getSubClient('media');
308
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
309 309
 	}
310 310
 
311 311
 
312 312
 	public function testGetSubClientDecoratorInvalid()
313 313
 	{
314
-		$this->context->getConfig()->set( 'admin/jqadm/product/media/decorators/global', array( 'Invalid' ) );
314
+		$this->context->getConfig()->set('admin/jqadm/product/media/decorators/global', array('Invalid'));
315 315
 
316
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
317
-		$this->object->getSubClient( 'media' );
316
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
317
+		$this->object->getSubClient('media');
318 318
 	}
319 319
 
320 320
 
321
-	public function getClientMock( $method )
321
+	public function getClientMock($method)
322 322
 	{
323
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Standard::class )
324
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
325
-			->setMethods( [$method] )
323
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Standard::class)
324
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
325
+			->setMethods([$method])
326 326
 			->getMock();
327 327
 
328
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
329
-		$object->setView( $this->getViewNoRender() );
328
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
329
+		$object->setView($this->getViewNoRender());
330 330
 
331 331
 		return $object;
332 332
 	}
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
 
335 335
 	protected function getViewNoRender()
336 336
 	{
337
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
338
-			->setConstructorArgs( array( [] ) )
339
-			->setMethods( array( 'render', 'config' ) )
337
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
338
+			->setConstructorArgs(array([]))
339
+			->setMethods(array('render', 'config'))
340 340
 			->getMock();
341 341
 
342
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
342
+		$manager = \Aimeos\MShop::create($this->context, 'product');
343 343
 
344
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'CNC' )->getId()];
345
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
346
-		$view->addHelper( 'param', $helper );
344
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('CNC')->getId()];
345
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
346
+		$view->addHelper('param', $helper);
347 347
 
348
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
349
-		$view->addHelper( 'access', $helper );
348
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
349
+		$view->addHelper('access', $helper);
350 350
 
351 351
 		return $view;
352 352
 	}
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
@@ -303,6 +303,9 @@
 block discarded – undo
303 303
 	}
304 304
 
305 305
 
306
+	/**
307
+	 * @param string $method
308
+	 */
306 309
 	public function getClientMock( $method )
307 310
 	{
308 311
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Standard::class )
Please login to merge, or discard this patch.
Spacing   +94 added lines, -94 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::class )->getMock();
23
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
24
-		$this->view ->addHelper( 'request', $helper );
22
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
23
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
24
+		$this->view ->addHelper('request', $helper);
25 25
 
26 26
 		$this->context = \TestHelperJqadm::getContext();
27 27
 
28
-		$this->object = new \Aimeos\Admin\JQAdm\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::create( $this->context, 'service' );
71
+		$manager = \Aimeos\MShop::create($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::create( $this->context, 'service' );
135
+		$manager = \Aimeos\MShop::create($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,16 +168,16 @@  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::class );
173
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
174 174
 		$object->getView();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSave()
179 179
 	{
180
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
180
+		$manager = \Aimeos\MShop::create($this->context, 'service');
181 181
 
182 182
 		$param = array(
183 183
 			'site' => 'unittest',
@@ -191,27 +191,27 @@  discard block
 block discarded – undo
191 191
 				'service.dateend' => null,
192 192
 				'service.position' => '2',
193 193
 				'config' => array(
194
-					'key' => array( 0 => 'test key' ),
195
-					'val' => array( 0 => 'test value' ),
194
+					'key' => array(0 => 'test key'),
195
+					'val' => array(0 => 'test value'),
196 196
 				),
197 197
 			),
198 198
 		);
199 199
 
200
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
201
-		$this->view->addHelper( 'param', $helper );
200
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
201
+		$this->view->addHelper('param', $helper);
202 202
 
203 203
 		$this->object->save();
204 204
 
205
-		$manager->deleteItem( $manager->findItem( 'test' )->getId() );
205
+		$manager->deleteItem($manager->findItem('test')->getId());
206 206
 	}
207 207
 
208 208
 
209 209
 	public function testSaveException()
210 210
 	{
211
-		$object = $this->getClientMock( 'fromArray' );
211
+		$object = $this->getClientMock('fromArray');
212 212
 
213
-		$object->expects( $this->once() )->method( 'fromArray' )
214
-			->will( $this->throwException( new \RuntimeException() ) );
213
+		$object->expects($this->once())->method('fromArray')
214
+			->will($this->throwException(new \RuntimeException()));
215 215
 
216 216
 		$object->save();
217 217
 	}
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
 
220 220
 	public function testSaveMShopException()
221 221
 	{
222
-		$object = $this->getClientMock( 'fromArray' );
222
+		$object = $this->getClientMock('fromArray');
223 223
 
224
-		$object->expects( $this->once() )->method( 'fromArray' )
225
-			->will( $this->throwException( new \RuntimeException() ) );
224
+		$object->expects($this->once())->method('fromArray')
225
+			->will($this->throwException(new \RuntimeException()));
226 226
 
227 227
 		$object->save();
228 228
 	}
@@ -230,10 +230,10 @@  discard block
 block discarded – undo
230 230
 
231 231
 	public function testSaveJQAdmException()
232 232
 	{
233
-		$object = $this->getClientMock( 'fromArray' );
233
+		$object = $this->getClientMock('fromArray');
234 234
 
235
-		$object->expects( $this->once() )->method( 'fromArray' )
236
-			->will( $this->throwException( new \RuntimeException() ) );
235
+		$object->expects($this->once())->method('fromArray')
236
+			->will($this->throwException(new \RuntimeException()));
237 237
 
238 238
 		$object->save();
239 239
 	}
@@ -244,27 +244,27 @@  discard block
 block discarded – undo
244 244
 		$param = array(
245 245
 			'site' => 'unittest', 'lang' => 'de',
246 246
 			'filter' => array(
247
-				'key' => array( 0 => 'service.code' ),
248
-				'op' => array( 0 => '==' ),
249
-				'val' => array( 0 => 'unitpaymentcode' ),
247
+				'key' => array(0 => 'service.code'),
248
+				'op' => array(0 => '=='),
249
+				'val' => array(0 => 'unitpaymentcode'),
250 250
 			),
251
-			'sort' => array( 'service.label', '-service.id' ),
251
+			'sort' => array('service.label', '-service.id'),
252 252
 		);
253
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
254
-		$this->view->addHelper( 'param', $helper );
253
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
254
+		$this->view->addHelper('param', $helper);
255 255
 
256 256
 		$result = $this->object->search();
257 257
 
258
-		$this->assertContains( '>unitpaymentlabel<', $result );
258
+		$this->assertContains('>unitpaymentlabel<', $result);
259 259
 	}
260 260
 
261 261
 
262 262
 	public function testSearchException()
263 263
 	{
264
-		$object = $this->getClientMock( 'initCriteria' );
264
+		$object = $this->getClientMock('initCriteria');
265 265
 
266
-		$object->expects( $this->once() )->method( 'initCriteria' )
267
-			->will( $this->throwException( new \RuntimeException() ) );
266
+		$object->expects($this->once())->method('initCriteria')
267
+			->will($this->throwException(new \RuntimeException()));
268 268
 
269 269
 		$object->search();
270 270
 	}
@@ -272,10 +272,10 @@  discard block
 block discarded – undo
272 272
 
273 273
 	public function testSearchMShopException()
274 274
 	{
275
-		$object = $this->getClientMock( 'initCriteria' );
275
+		$object = $this->getClientMock('initCriteria');
276 276
 
277
-		$object->expects( $this->once() )->method( 'initCriteria' )
278
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
277
+		$object->expects($this->once())->method('initCriteria')
278
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
279 279
 
280 280
 		$object->search();
281 281
 	}
@@ -283,34 +283,34 @@  discard block
 block discarded – undo
283 283
 
284 284
 	public function testGetSubClient()
285 285
 	{
286
-		$result = $this->object->getSubClient( 'media' );
287
-		$this->assertInstanceOf( \Aimeos\Admin\JQAdm\Iface::class, $result );
286
+		$result = $this->object->getSubClient('media');
287
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
288 288
 	}
289 289
 
290 290
 
291 291
 	public function testGetSubClientInvalid()
292 292
 	{
293
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
294
-		$this->object->getSubClient( '$unknown$' );
293
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
294
+		$this->object->getSubClient('$unknown$');
295 295
 	}
296 296
 
297 297
 
298 298
 	public function testGetSubClientUnknown()
299 299
 	{
300
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
301
-		$this->object->getSubClient( 'unknown' );
300
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
301
+		$this->object->getSubClient('unknown');
302 302
 	}
303 303
 
304 304
 
305
-	public function getClientMock( $method )
305
+	public function getClientMock($method)
306 306
 	{
307
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Service\Standard::class )
308
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
309
-			->setMethods( [$method] )
307
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Service\Standard::class)
308
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
309
+			->setMethods([$method])
310 310
 			->getMock();
311 311
 
312
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
313
-		$object->setView( $this->getViewNoRender() );
312
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
313
+		$object->setView($this->getViewNoRender());
314 314
 
315 315
 		return $object;
316 316
 	}
@@ -318,19 +318,19 @@  discard block
 block discarded – undo
318 318
 
319 319
 	protected function getViewNoRender()
320 320
 	{
321
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
322
-			->setConstructorArgs( array( [] ) )
323
-			->setMethods( array( 'render', 'config' ) )
321
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
322
+			->setConstructorArgs(array([]))
323
+			->setMethods(array('render', 'config'))
324 324
 			->getMock();
325 325
 
326
-		$manager = \Aimeos\MShop::create( $this->context, 'service' );
326
+		$manager = \Aimeos\MShop::create($this->context, 'service');
327 327
 
328
-		$param = ['site' => 'unittest', 'id' => $manager->findItem( 'unitpaymentcode' )->getId()];
329
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
330
-		$view->addHelper( 'param', $helper );
328
+		$param = ['site' => 'unittest', 'id' => $manager->findItem('unitpaymentcode')->getId()];
329
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param);
330
+		$view->addHelper('param', $helper);
331 331
 
332
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] );
333
-		$view->addHelper( 'access', $helper );
332
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
333
+		$view->addHelper('access', $helper);
334 334
 
335 335
 		return $view;
336 336
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Subscription/StandardTest.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -293,6 +293,9 @@
 block discarded – undo
293 293
 	}
294 294
 
295 295
 
296
+	/**
297
+	 * @param string $method
298
+	 */
296 299
 	public function getClientMock( $method )
297 300
 	{
298 301
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Subscription\Standard::class )
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\Subscription\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\Subscription\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::create( $this->context, 'subscription' );
67
+		$manager = \Aimeos\MShop::create($this->context, 'subscription');
68 68
 
69 69
 		$param = ['site' => 'unittest', 'id' => $this->getSubscriptionId()];
70
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
71
-		$this->view->addHelper( 'param', $helper );
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( '2010-01-01', $result );
75
+		$this->assertContains('2010-01-01', $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::create( $this->context, 'subscription' );
131
+		$manager = \Aimeos\MShop::create($this->context, 'subscription');
132 132
 
133 133
 		$param = ['site' => 'unittest', 'id' => $this->getSubscriptionId()];
134
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
135
-		$this->view->addHelper( 'param', $helper );
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( '2010-01-01', $result );
139
+		$this->assertContains('2010-01-01', $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,23 +164,23 @@  discard block
 block discarded – undo
164 164
 
165 165
 	public function testGetViewException()
166 166
 	{
167
-		$object = new \Aimeos\Admin\JQAdm\Subscription\Standard( $this->context, [] );
167
+		$object = new \Aimeos\Admin\JQAdm\Subscription\Standard($this->context, []);
168 168
 
169
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
169
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
170 170
 		$object->getView();
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testSave()
175 175
 	{
176
-		$manager = \Aimeos\MShop::create( $this->context, 'order/base/product' );
177
-		$items = $manager->searchItems( $manager->createSearch()->setSlice( 0, 1 ) );
176
+		$manager = \Aimeos\MShop::create($this->context, 'order/base/product');
177
+		$items = $manager->searchItems($manager->createSearch()->setSlice(0, 1));
178 178
 
179
-		if( ( $item = reset( $items ) ) === false ) {
180
-			throw new \Exception( 'No order product item found' );
179
+		if (($item = reset($items)) === false) {
180
+			throw new \Exception('No order product item found');
181 181
 		}
182 182
 
183
-		$manager = \Aimeos\MShop::create( $this->context, 'subscription' );
183
+		$manager = \Aimeos\MShop::create($this->context, 'subscription');
184 184
 
185 185
 		$param = array(
186 186
 			'site' => 'unittest',
@@ -195,21 +195,21 @@  discard block
 block discarded – undo
195 195
 			),
196 196
 		);
197 197
 
198
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
199
-		$this->view->addHelper( 'param', $helper );
198
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
199
+		$this->view->addHelper('param', $helper);
200 200
 
201 201
 		$this->object->save();
202 202
 
203
-		$manager->deleteItem( $this->getSubscriptionId( '2006-06-06' ) );
203
+		$manager->deleteItem($this->getSubscriptionId('2006-06-06'));
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 => 'subscription.dateend' ),
246
-				'op' => array( 0 => '>=' ),
247
-				'val' => array( 0 => '2010-01-01' ),
245
+				'key' => array(0 => 'subscription.dateend'),
246
+				'op' => array(0 => '>='),
247
+				'val' => array(0 => '2010-01-01'),
248 248
 			),
249
-			'sort' => array( 'subscription.datenext', '-subscription.id' ),
249
+			'sort' => array('subscription.datenext', '-subscription.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( '2010-01-01', $result );
256
+		$this->assertContains('2010-01-01', $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::class );
285
-		$this->object->getSubClient( '$unknown$' );
284
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class );
292
-		$this->object->getSubClient( 'unknown' );
291
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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\Subscription\Standard::class )
299
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
300
-			->setMethods( [$method] )
298
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Subscription\Standard::class)
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,33 +309,33 @@  discard block
 block discarded – undo
309 309
 
310 310
 	protected function getViewNoRender()
311 311
 	{
312
-		$view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class )
313
-			->setConstructorArgs( array( [] ) )
314
-			->setMethods( array( 'render', 'config' ) )
312
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
313
+			->setConstructorArgs(array([]))
314
+			->setMethods(array('render', 'config'))
315 315
 			->getMock();
316 316
 
317
-		$manager = \Aimeos\MShop::create( $this->context, 'subscription' );
317
+		$manager = \Aimeos\MShop::create($this->context, 'subscription');
318 318
 
319 319
 		$param = ['site' => 'unittest', 'id' => $this->getSubscriptionId()];
320
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param );
321
-		$view->addHelper( 'param', $helper );
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( $view, [] );
324
-		$view->addHelper( 'access', $helper );
323
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []);
324
+		$view->addHelper('access', $helper);
325 325
 
326 326
 		return $view;
327 327
 	}
328 328
 
329 329
 
330
-	protected function getSubscriptionId( $end = '2010-01-01' )
330
+	protected function getSubscriptionId($end = '2010-01-01')
331 331
 	{
332
-		$manager = \Aimeos\MShop::create( $this->context, 'subscription' );
333
-		$search = $manager->createSearch()->setSlice( 0, 1 );
334
-		$search->setConditions( $search->compare( '==', 'subscription.dateend', $end ) );
335
-		$items = $manager->searchItems( $search );
332
+		$manager = \Aimeos\MShop::create($this->context, 'subscription');
333
+		$search = $manager->createSearch()->setSlice(0, 1);
334
+		$search->setConditions($search->compare('==', 'subscription.dateend', $end));
335
+		$items = $manager->searchItems($search);
336 336
 
337
-		if( ( $item = reset( $items ) ) === false ) {
338
-			throw new \Exception( sprintf( 'No subscription item found for end date "%1$s"', $end ) );
337
+		if (($item = reset($items)) === false) {
338
+			throw new \Exception(sprintf('No subscription item found for end date "%1$s"', $end));
339 339
 		}
340 340
 
341 341
 		return $item->getId();
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
@@ -290,6 +290,9 @@
 block discarded – undo
290 290
 	}
291 291
 
292 292
 
293
+	/**
294
+	 * @param string $method
295
+	 */
293 296
 	public function getClientMock( $method )
294 297
 	{
295 298
 		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Standard::class )
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::create( $this->context, 'supplier' );
67
+		$manager = \Aimeos\MShop::create($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::create( $this->context, 'supplier' );
131
+		$manager = \Aimeos\MShop::create($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::class );
169
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
170 170
 		$object->getView();
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testSave()
175 175
 	{
176
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
176
+		$manager = \Aimeos\MShop::create($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::class, $result );
274
+		$result = $this->object->getSubClient('address');
275
+		$this->assertInstanceOf(\Aimeos\Admin\JQAdm\Iface::class, $result);
276 276
 	}
277 277
 
278 278
 
279 279
 	public function testGetSubClientInvalid()
280 280
 	{
281
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
282
-		$this->object->getSubClient( '$unknown$' );
281
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
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::class );
289
-		$this->object->getSubClient( 'unknown' );
288
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
289
+		$this->object->getSubClient('unknown');
290 290
 	}
291 291
 
292 292
 
293
-	public function getClientMock( $method )
293
+	public function getClientMock($method)
294 294
 	{
295
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Supplier\Standard::class )
296
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
297
-			->setMethods( [$method] )
295
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Supplier\Standard::class)
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::class )
310
-			->setConstructorArgs( array( [] ) )
311
-			->setMethods( array( 'render', 'config' ) )
309
+		$view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class)
310
+			->setConstructorArgs(array([]))
311
+			->setMethods(array('render', 'config'))
312 312
 			->getMock();
313 313
 
314
-		$manager = \Aimeos\MShop::create( $this->context, 'supplier' );
314
+		$manager = \Aimeos\MShop::create($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.