@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Text\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Text\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'text/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'text/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'name', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('name', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'name', $result ); |
|
85 | + $this->assertContains('name', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'text/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'text/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'name', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('name', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'name', $result ); |
|
169 | + $this->assertContains('name', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Text\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Text\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'text/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'text/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'text.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'name' ), |
|
291 | + 'key' => array(0 => 'text.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'name'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-text.type.id' ), |
|
295 | + 'sort' => array('-text.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>name<', $result ); |
|
302 | + $this->assertContains('>name<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'text/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'text/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'name', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('name', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'text.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'text.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-text.lists.type.id' ), |
|
295 | + 'sort' => array('-text.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Text\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'text/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'text/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Price\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Price\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'price' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'price')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'price.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'price.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-price.type.id' ), |
|
295 | + 'sort' => array('-price.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'price/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'price/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | $this->view = \TestHelperJqadm::getView(); |
22 | 22 | $this->context = \TestHelperJqadm::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard( $this->context ); |
|
25 | - $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context ); |
|
26 | - $this->object->setAimeos( \TestHelperJqadm::getAimeos() ); |
|
27 | - $this->object->setView( $this->view ); |
|
24 | + $this->object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard($this->context); |
|
25 | + $this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context); |
|
26 | + $this->object->setAimeos(\TestHelperJqadm::getAimeos()); |
|
27 | + $this->object->setView($this->view); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | 31 | protected function tearDown() |
32 | 32 | { |
33 | - unset( $this->object, $this->view, $this->context ); |
|
33 | + unset($this->object, $this->view, $this->context); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | |
@@ -42,15 +42,15 @@ discard block |
||
42 | 42 | |
43 | 43 | public function testCreateException() |
44 | 44 | { |
45 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
46 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
47 | - ->setMethods( array( 'getSubClients' ) ) |
|
45 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
46 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
47 | + ->setMethods(array('getSubClients')) |
|
48 | 48 | ->getMock(); |
49 | 49 | |
50 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
51 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
50 | + $object->expects($this->once())->method('getSubClients') |
|
51 | + ->will($this->throwException(new \RuntimeException())); |
|
52 | 52 | |
53 | - $object->setView( $this->getViewNoRender() ); |
|
53 | + $object->setView($this->getViewNoRender()); |
|
54 | 54 | |
55 | 55 | $object->create(); |
56 | 56 | } |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | public function testCreateMShopException() |
60 | 60 | { |
61 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
62 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
63 | - ->setMethods( array( 'getSubClients' ) ) |
|
61 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
62 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
63 | + ->setMethods(array('getSubClients')) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
67 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
66 | + $object->expects($this->once())->method('getSubClients') |
|
67 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
68 | 68 | |
69 | - $object->setView( $this->getViewNoRender() ); |
|
69 | + $object->setView($this->getViewNoRender()); |
|
70 | 70 | |
71 | 71 | $object->create(); |
72 | 72 | } |
@@ -74,29 +74,29 @@ discard block |
||
74 | 74 | |
75 | 75 | public function testCopy() |
76 | 76 | { |
77 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
77 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
78 | 78 | |
79 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
80 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
81 | - $this->view->addHelper( 'param', $helper ); |
|
79 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
80 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
81 | + $this->view->addHelper('param', $helper); |
|
82 | 82 | |
83 | 83 | $result = $this->object->copy(); |
84 | 84 | |
85 | - $this->assertContains( 'default', $result ); |
|
85 | + $this->assertContains('default', $result); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testCopyException() |
90 | 90 | { |
91 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
92 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
93 | - ->setMethods( array( 'getSubClients' ) ) |
|
91 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
92 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
93 | + ->setMethods(array('getSubClients')) |
|
94 | 94 | ->getMock(); |
95 | 95 | |
96 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
97 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
96 | + $object->expects($this->once())->method('getSubClients') |
|
97 | + ->will($this->throwException(new \RuntimeException())); |
|
98 | 98 | |
99 | - $object->setView( $this->getViewNoRender() ); |
|
99 | + $object->setView($this->getViewNoRender()); |
|
100 | 100 | |
101 | 101 | $object->copy(); |
102 | 102 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testCopyMShopException() |
106 | 106 | { |
107 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
108 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
109 | - ->setMethods( array( 'getSubClients' ) ) |
|
107 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
108 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
109 | + ->setMethods(array('getSubClients')) |
|
110 | 110 | ->getMock(); |
111 | 111 | |
112 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
113 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
112 | + $object->expects($this->once())->method('getSubClients') |
|
113 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
114 | 114 | |
115 | - $object->setView( $this->getViewNoRender() ); |
|
115 | + $object->setView($this->getViewNoRender()); |
|
116 | 116 | |
117 | 117 | $object->copy(); |
118 | 118 | } |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | |
121 | 121 | public function testDelete() |
122 | 122 | { |
123 | - $this->assertNotNull( $this->object->delete() ); |
|
123 | + $this->assertNotNull($this->object->delete()); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
127 | 127 | public function testDeleteException() |
128 | 128 | { |
129 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
130 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
131 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
129 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
130 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
131 | + ->setMethods(array('getSubClients', 'search')) |
|
132 | 132 | ->getMock(); |
133 | 133 | |
134 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
135 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
134 | + $object->expects($this->once())->method('getSubClients') |
|
135 | + ->will($this->throwException(new \RuntimeException())); |
|
136 | 136 | |
137 | - $object->setView( $this->getViewNoRender() ); |
|
137 | + $object->setView($this->getViewNoRender()); |
|
138 | 138 | |
139 | 139 | $object->delete(); |
140 | 140 | } |
@@ -142,15 +142,15 @@ discard block |
||
142 | 142 | |
143 | 143 | public function testDeleteMShopException() |
144 | 144 | { |
145 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
146 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
147 | - ->setMethods( array( 'getSubClients', 'search' ) ) |
|
145 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
146 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
147 | + ->setMethods(array('getSubClients', 'search')) |
|
148 | 148 | ->getMock(); |
149 | 149 | |
150 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
151 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
150 | + $object->expects($this->once())->method('getSubClients') |
|
151 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
152 | 152 | |
153 | - $object->setView( $this->getViewNoRender() ); |
|
153 | + $object->setView($this->getViewNoRender()); |
|
154 | 154 | |
155 | 155 | $object->delete(); |
156 | 156 | } |
@@ -158,29 +158,29 @@ discard block |
||
158 | 158 | |
159 | 159 | public function testGet() |
160 | 160 | { |
161 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
161 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
162 | 162 | |
163 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
164 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
165 | - $this->view->addHelper( 'param', $helper ); |
|
163 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
164 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
165 | + $this->view->addHelper('param', $helper); |
|
166 | 166 | |
167 | 167 | $result = $this->object->get(); |
168 | 168 | |
169 | - $this->assertContains( 'default', $result ); |
|
169 | + $this->assertContains('default', $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | 173 | public function testGetException() |
174 | 174 | { |
175 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
176 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
177 | - ->setMethods( array( 'getSubClients' ) ) |
|
175 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
176 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
177 | + ->setMethods(array('getSubClients')) |
|
178 | 178 | ->getMock(); |
179 | 179 | |
180 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
181 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
180 | + $object->expects($this->once())->method('getSubClients') |
|
181 | + ->will($this->throwException(new \RuntimeException())); |
|
182 | 182 | |
183 | - $object->setView( $this->getViewNoRender() ); |
|
183 | + $object->setView($this->getViewNoRender()); |
|
184 | 184 | |
185 | 185 | $object->get(); |
186 | 186 | } |
@@ -188,15 +188,15 @@ discard block |
||
188 | 188 | |
189 | 189 | public function testGetMShopException() |
190 | 190 | { |
191 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
192 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
193 | - ->setMethods( array( 'getSubClients' ) ) |
|
191 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
192 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
193 | + ->setMethods(array('getSubClients')) |
|
194 | 194 | ->getMock(); |
195 | 195 | |
196 | - $object->expects( $this->once() )->method( 'getSubClients' ) |
|
197 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
196 | + $object->expects($this->once())->method('getSubClients') |
|
197 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
198 | 198 | |
199 | - $object->setView( $this->getViewNoRender() ); |
|
199 | + $object->setView($this->getViewNoRender()); |
|
200 | 200 | |
201 | 201 | $object->get(); |
202 | 202 | } |
@@ -204,16 +204,16 @@ discard block |
||
204 | 204 | |
205 | 205 | public function testGetViewException() |
206 | 206 | { |
207 | - $object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard( $this->context, [] ); |
|
207 | + $object = new \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard($this->context, []); |
|
208 | 208 | |
209 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
209 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
210 | 210 | $object->getView(); |
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | 214 | public function testSave() |
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
217 | 217 | |
218 | 218 | $param = array( |
219 | 219 | 'type' => 'unittest', |
@@ -226,26 +226,26 @@ discard block |
||
226 | 226 | ), |
227 | 227 | ); |
228 | 228 | |
229 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
230 | - $this->view->addHelper( 'param', $helper ); |
|
229 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
230 | + $this->view->addHelper('param', $helper); |
|
231 | 231 | |
232 | 232 | $this->object->save(); |
233 | 233 | |
234 | - $manager->deleteItem( $manager->findItem( 'jqadm@test', [], 'product' )->getId() ); |
|
234 | + $manager->deleteItem($manager->findItem('jqadm@test', [], 'product')->getId()); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
238 | 238 | public function testSaveException() |
239 | 239 | { |
240 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
241 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
242 | - ->setMethods( array( 'fromArray' ) ) |
|
240 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
241 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
242 | + ->setMethods(array('fromArray')) |
|
243 | 243 | ->getMock(); |
244 | 244 | |
245 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
246 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
245 | + $object->expects($this->once())->method('fromArray') |
|
246 | + ->will($this->throwException(new \RuntimeException())); |
|
247 | 247 | |
248 | - $object->setView( $this->getViewNoRender() ); |
|
248 | + $object->setView($this->getViewNoRender()); |
|
249 | 249 | |
250 | 250 | $object->save(); |
251 | 251 | } |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | public function testSaveMShopException() |
255 | 255 | { |
256 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
257 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
258 | - ->setMethods( array( 'fromArray' ) ) |
|
256 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
257 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
258 | + ->setMethods(array('fromArray')) |
|
259 | 259 | ->getMock(); |
260 | 260 | |
261 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
262 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
261 | + $object->expects($this->once())->method('fromArray') |
|
262 | + ->will($this->throwException(new \RuntimeException())); |
|
263 | 263 | |
264 | - $object->setView( $this->getViewNoRender() ); |
|
264 | + $object->setView($this->getViewNoRender()); |
|
265 | 265 | |
266 | 266 | $object->save(); |
267 | 267 | } |
@@ -269,15 +269,15 @@ discard block |
||
269 | 269 | |
270 | 270 | public function testSaveJQAdmException() |
271 | 271 | { |
272 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
273 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
274 | - ->setMethods( array( 'fromArray' ) ) |
|
272 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
273 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
274 | + ->setMethods(array('fromArray')) |
|
275 | 275 | ->getMock(); |
276 | 276 | |
277 | - $object->expects( $this->once() )->method( 'fromArray' ) |
|
278 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
277 | + $object->expects($this->once())->method('fromArray') |
|
278 | + ->will($this->throwException(new \RuntimeException())); |
|
279 | 279 | |
280 | - $object->setView( $this->getViewNoRender() ); |
|
280 | + $object->setView($this->getViewNoRender()); |
|
281 | 281 | |
282 | 282 | $object->save(); |
283 | 283 | } |
@@ -288,32 +288,32 @@ discard block |
||
288 | 288 | $param = array( |
289 | 289 | 'type' => 'unittest', 'lang' => 'de', |
290 | 290 | 'filter' => array( |
291 | - 'key' => array( 0 => 'price.lists.type.code' ), |
|
292 | - 'op' => array( 0 => '==' ), |
|
293 | - 'val' => array( 0 => 'default' ), |
|
291 | + 'key' => array(0 => 'price.lists.type.code'), |
|
292 | + 'op' => array(0 => '=='), |
|
293 | + 'val' => array(0 => 'default'), |
|
294 | 294 | ), |
295 | - 'sort' => array( '-price.lists.type.id' ), |
|
295 | + 'sort' => array('-price.lists.type.id'), |
|
296 | 296 | ); |
297 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param ); |
|
298 | - $this->view->addHelper( 'param', $helper ); |
|
297 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param); |
|
298 | + $this->view->addHelper('param', $helper); |
|
299 | 299 | |
300 | 300 | $result = $this->object->search(); |
301 | 301 | |
302 | - $this->assertContains( '>default<', $result ); |
|
302 | + $this->assertContains('>default<', $result); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
306 | 306 | public function testSearchException() |
307 | 307 | { |
308 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
309 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
310 | - ->setMethods( array( 'initCriteria' ) ) |
|
308 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
309 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
310 | + ->setMethods(array('initCriteria')) |
|
311 | 311 | ->getMock(); |
312 | 312 | |
313 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
314 | - ->will( $this->throwException( new \RuntimeException() ) ); |
|
313 | + $object->expects($this->once())->method('initCriteria') |
|
314 | + ->will($this->throwException(new \RuntimeException())); |
|
315 | 315 | |
316 | - $object->setView( $this->getViewNoRender() ); |
|
316 | + $object->setView($this->getViewNoRender()); |
|
317 | 317 | |
318 | 318 | $object->search(); |
319 | 319 | } |
@@ -321,15 +321,15 @@ discard block |
||
321 | 321 | |
322 | 322 | public function testSearchMShopException() |
323 | 323 | { |
324 | - $object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class ) |
|
325 | - ->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) ) |
|
326 | - ->setMethods( array( 'initCriteria' ) ) |
|
324 | + $object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Type\Price\Lists\Standard::class) |
|
325 | + ->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths())) |
|
326 | + ->setMethods(array('initCriteria')) |
|
327 | 327 | ->getMock(); |
328 | 328 | |
329 | - $object->expects( $this->once() )->method( 'initCriteria' ) |
|
330 | - ->will( $this->throwException( new \Aimeos\MShop\Exception() ) ); |
|
329 | + $object->expects($this->once())->method('initCriteria') |
|
330 | + ->will($this->throwException(new \Aimeos\MShop\Exception())); |
|
331 | 331 | |
332 | - $object->setView( $this->getViewNoRender() ); |
|
332 | + $object->setView($this->getViewNoRender()); |
|
333 | 333 | |
334 | 334 | $object->search(); |
335 | 335 | } |
@@ -337,33 +337,33 @@ discard block |
||
337 | 337 | |
338 | 338 | public function testGetSubClientInvalid() |
339 | 339 | { |
340 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
341 | - $this->object->getSubClient( '$unknown$' ); |
|
340 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
341 | + $this->object->getSubClient('$unknown$'); |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | |
345 | 345 | public function testGetSubClientUnknown() |
346 | 346 | { |
347 | - $this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class ); |
|
348 | - $this->object->getSubClient( 'unknown' ); |
|
347 | + $this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class); |
|
348 | + $this->object->getSubClient('unknown'); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | |
352 | 352 | protected function getViewNoRender() |
353 | 353 | { |
354 | - $view = $this->getMockBuilder( \Aimeos\MW\View\Standard::class ) |
|
355 | - ->setConstructorArgs( array( [] ) ) |
|
356 | - ->setMethods( array( 'render', 'config' ) ) |
|
354 | + $view = $this->getMockBuilder(\Aimeos\MW\View\Standard::class) |
|
355 | + ->setConstructorArgs(array([])) |
|
356 | + ->setMethods(array('render', 'config')) |
|
357 | 357 | ->getMock(); |
358 | 358 | |
359 | - $manager = \Aimeos\MShop::create( $this->context, 'price/lists/type' ); |
|
359 | + $manager = \Aimeos\MShop::create($this->context, 'price/lists/type'); |
|
360 | 360 | |
361 | - $param = ['type' => 'unittest', 'id' => $manager->findItem( 'default', [], 'product' )->getId()]; |
|
362 | - $helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $param ); |
|
363 | - $view->addHelper( 'param', $helper ); |
|
361 | + $param = ['type' => 'unittest', 'id' => $manager->findItem('default', [], 'product')->getId()]; |
|
362 | + $helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $param); |
|
363 | + $view->addHelper('param', $helper); |
|
364 | 364 | |
365 | - $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, [] ); |
|
366 | - $view->addHelper( 'access', $helper ); |
|
365 | + $helper = new \Aimeos\MW\View\Helper\Access\Standard($view, []); |
|
366 | + $view->addHelper('access', $helper); |
|
367 | 367 | |
368 | 368 | return $view; |
369 | 369 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Catalog; |
12 | 12 | |
13 | -sprintf( 'catalog' ); // for translation |
|
13 | +sprintf('catalog'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,38 +35,38 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
43 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
43 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemRootId = $this->getRootId(); |
48 | 48 | $view->itemBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $idx => $client ) |
|
50 | + foreach ($this->getSubClients() as $idx => $client) |
|
51 | 51 | { |
52 | 52 | $view->tabindex = ++$idx + 1; |
53 | 53 | $view->itemBody .= $client->copy(); |
54 | 54 | } |
55 | 55 | } |
56 | - catch( \Aimeos\MShop\Exception $e ) |
|
56 | + catch (\Aimeos\MShop\Exception $e) |
|
57 | 57 | { |
58 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
59 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
60 | - $this->logException( $e ); |
|
58 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
59 | + $view->errors = $view->get('errors', []) + $error; |
|
60 | + $this->logException($e); |
|
61 | 61 | } |
62 | - catch( \Exception $e ) |
|
62 | + catch (\Exception $e) |
|
63 | 63 | { |
64 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
65 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
66 | - $this->logException( $e ); |
|
64 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
65 | + $view->errors = $view->get('errors', []) + $error; |
|
66 | + $this->logException($e); |
|
67 | 67 | } |
68 | 68 | |
69 | - return $this->render( $view ); |
|
69 | + return $this->render($view); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | |
@@ -82,40 +82,40 @@ discard block |
||
82 | 82 | |
83 | 83 | try |
84 | 84 | { |
85 | - $data = $view->param( 'item', [] ); |
|
85 | + $data = $view->param('item', []); |
|
86 | 86 | |
87 | - if( !isset( $view->item ) ) { |
|
88 | - $view->item = \Aimeos\MShop::create( $context, 'catalog' )->createItem(); |
|
87 | + if (!isset($view->item)) { |
|
88 | + $view->item = \Aimeos\MShop::create($context, 'catalog')->createItem(); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $data['catalog.siteid'] = $view->item->getSiteId(); |
92 | - $data['catalog.parentid'] = $view->item->getParentId() ?: $view->param( 'item/catalog.parentid' ); |
|
92 | + $data['catalog.parentid'] = $view->item->getParentId() ?: $view->param('item/catalog.parentid'); |
|
93 | 93 | |
94 | 94 | $view->itemSubparts = $this->getSubClientNames(); |
95 | 95 | $view->itemRootId = $this->getRootId(); |
96 | 96 | $view->itemData = $data; |
97 | 97 | $view->itemBody = ''; |
98 | 98 | |
99 | - foreach( $this->getSubClients() as $idx => $client ) |
|
99 | + foreach ($this->getSubClients() as $idx => $client) |
|
100 | 100 | { |
101 | 101 | $view->tabindex = ++$idx + 1; |
102 | 102 | $view->itemBody .= $client->create(); |
103 | 103 | } |
104 | 104 | } |
105 | - catch( \Aimeos\MShop\Exception $e ) |
|
105 | + catch (\Aimeos\MShop\Exception $e) |
|
106 | 106 | { |
107 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
108 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
109 | - $this->logException( $e ); |
|
107 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
108 | + $view->errors = $view->get('errors', []) + $error; |
|
109 | + $this->logException($e); |
|
110 | 110 | } |
111 | - catch( \Exception $e ) |
|
111 | + catch (\Exception $e) |
|
112 | 112 | { |
113 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
114 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
115 | - $this->logException( $e ); |
|
113 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
114 | + $view->errors = $view->get('errors', []) + $error; |
|
115 | + $this->logException($e); |
|
116 | 116 | } |
117 | 117 | |
118 | - return $this->render( $view ); |
|
118 | + return $this->render($view); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | |
@@ -129,39 +129,39 @@ discard block |
||
129 | 129 | $view = $this->getView(); |
130 | 130 | $context = $this->getContext(); |
131 | 131 | |
132 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
132 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
133 | 133 | $manager->begin(); |
134 | 134 | |
135 | 135 | try |
136 | 136 | { |
137 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
138 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
137 | + if (($id = $view->param('id')) === null) { |
|
138 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
139 | 139 | } |
140 | 140 | |
141 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
141 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
142 | 142 | |
143 | - foreach( $this->getSubClients() as $client ) { |
|
143 | + foreach ($this->getSubClients() as $client) { |
|
144 | 144 | $client->delete(); |
145 | 145 | } |
146 | 146 | |
147 | - $manager->saveItem( $view->item ); |
|
148 | - $manager->deleteItem( $id ); |
|
147 | + $manager->saveItem($view->item); |
|
148 | + $manager->deleteItem($id); |
|
149 | 149 | $manager->commit(); |
150 | 150 | |
151 | - $this->nextAction( $view, 'search', 'catalog', null, 'delete' ); |
|
151 | + $this->nextAction($view, 'search', 'catalog', null, 'delete'); |
|
152 | 152 | return; |
153 | 153 | } |
154 | - catch( \Aimeos\MShop\Exception $e ) |
|
154 | + catch (\Aimeos\MShop\Exception $e) |
|
155 | 155 | { |
156 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
157 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
158 | - $this->logException( $e ); |
|
156 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
157 | + $view->errors = $view->get('errors', []) + $error; |
|
158 | + $this->logException($e); |
|
159 | 159 | } |
160 | - catch( \Exception $e ) |
|
160 | + catch (\Exception $e) |
|
161 | 161 | { |
162 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
163 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
164 | - $this->logException( $e ); |
|
162 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
163 | + $view->errors = $view->get('errors', []) + $error; |
|
164 | + $this->logException($e); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | $manager->rollback(); |
@@ -182,38 +182,38 @@ discard block |
||
182 | 182 | |
183 | 183 | try |
184 | 184 | { |
185 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
186 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
185 | + if (($id = $view->param('id')) === null) { |
|
186 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
187 | 187 | } |
188 | 188 | |
189 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
189 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
190 | 190 | |
191 | - $view->item = $manager->getItem( $id, $this->getDomains() ); |
|
191 | + $view->item = $manager->getItem($id, $this->getDomains()); |
|
192 | 192 | $view->itemSubparts = $this->getSubClientNames(); |
193 | - $view->itemData = $this->toArray( $view->item ); |
|
193 | + $view->itemData = $this->toArray($view->item); |
|
194 | 194 | $view->itemRootId = $this->getRootId(); |
195 | 195 | $view->itemBody = ''; |
196 | 196 | |
197 | - foreach( $this->getSubClients() as $idx => $client ) |
|
197 | + foreach ($this->getSubClients() as $idx => $client) |
|
198 | 198 | { |
199 | 199 | $view->tabindex = ++$idx + 1; |
200 | 200 | $view->itemBody .= $client->get(); |
201 | 201 | } |
202 | 202 | } |
203 | - catch( \Aimeos\MShop\Exception $e ) |
|
203 | + catch (\Aimeos\MShop\Exception $e) |
|
204 | 204 | { |
205 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
206 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
207 | - $this->logException( $e ); |
|
205 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
206 | + $view->errors = $view->get('errors', []) + $error; |
|
207 | + $this->logException($e); |
|
208 | 208 | } |
209 | - catch( \Exception $e ) |
|
209 | + catch (\Exception $e) |
|
210 | 210 | { |
211 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
212 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
213 | - $this->logException( $e ); |
|
211 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
212 | + $view->errors = $view->get('errors', []) + $error; |
|
213 | + $this->logException($e); |
|
214 | 214 | } |
215 | 215 | |
216 | - return $this->render( $view ); |
|
216 | + return $this->render($view); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -227,40 +227,40 @@ discard block |
||
227 | 227 | $view = $this->getView(); |
228 | 228 | $context = $this->getContext(); |
229 | 229 | |
230 | - $manager = \Aimeos\MShop::create( $context, 'catalog' ); |
|
230 | + $manager = \Aimeos\MShop::create($context, 'catalog'); |
|
231 | 231 | $manager->begin(); |
232 | 232 | |
233 | 233 | try |
234 | 234 | { |
235 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
236 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
235 | + $item = $this->fromArray($view->param('item', [])); |
|
236 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
237 | 237 | $view->itemBody = ''; |
238 | 238 | |
239 | - foreach( $this->getSubClients() as $client ) { |
|
239 | + foreach ($this->getSubClients() as $client) { |
|
240 | 240 | $view->itemBody .= $client->save(); |
241 | 241 | } |
242 | 242 | |
243 | - $manager->saveItem( clone $view->item ); |
|
243 | + $manager->saveItem(clone $view->item); |
|
244 | 244 | $manager->commit(); |
245 | 245 | |
246 | - $this->nextAction( $view, $view->param( 'next' ), 'catalog', $view->item->getId(), 'save' ); |
|
246 | + $this->nextAction($view, $view->param('next'), 'catalog', $view->item->getId(), 'save'); |
|
247 | 247 | return; |
248 | 248 | } |
249 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
249 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
250 | 250 | { |
251 | 251 | // fall through to create |
252 | 252 | } |
253 | - catch( \Aimeos\MShop\Exception $e ) |
|
253 | + catch (\Aimeos\MShop\Exception $e) |
|
254 | 254 | { |
255 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
256 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
257 | - $this->logException( $e ); |
|
255 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
256 | + $view->errors = $view->get('errors', []) + $error; |
|
257 | + $this->logException($e); |
|
258 | 258 | } |
259 | - catch( \Exception $e ) |
|
259 | + catch (\Exception $e) |
|
260 | 260 | { |
261 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
262 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
263 | - $this->logException( $e ); |
|
261 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
262 | + $view->errors = $view->get('errors', []) + $error; |
|
263 | + $this->logException($e); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | $manager->rollback(); |
@@ -281,24 +281,24 @@ discard block |
||
281 | 281 | |
282 | 282 | try |
283 | 283 | { |
284 | - $view->item = \Aimeos\MShop::create( $context, 'catalog' )->createItem(); |
|
284 | + $view->item = \Aimeos\MShop::create($context, 'catalog')->createItem(); |
|
285 | 285 | $view->itemRootId = $this->getRootId(); |
286 | 286 | $view->itemBody = ''; |
287 | 287 | } |
288 | - catch( \Aimeos\MShop\Exception $e ) |
|
288 | + catch (\Aimeos\MShop\Exception $e) |
|
289 | 289 | { |
290 | - $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
291 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
292 | - $this->logException( $e ); |
|
290 | + $error = array('catalog-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
291 | + $view->errors = $view->get('errors', []) + $error; |
|
292 | + $this->logException($e); |
|
293 | 293 | } |
294 | - catch( \Exception $e ) |
|
294 | + catch (\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | 300 | |
301 | - return $this->render( $view ); |
|
301 | + return $this->render($view); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * @param string|null $name Name of the sub-client (Default if null) |
310 | 310 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
311 | 311 | */ |
312 | - public function getSubClient( $type, $name = null ) |
|
312 | + public function getSubClient($type, $name = null) |
|
313 | 313 | { |
314 | 314 | /** admin/jqadm/catalog/decorators/excludes |
315 | 315 | * Excludes decorators added by the "common" option from the catalog JQAdm client |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | * @see admin/jqadm/catalog/decorators/excludes |
385 | 385 | * @see admin/jqadm/catalog/decorators/global |
386 | 386 | */ |
387 | - return $this->createSubClient( 'catalog/' . $type, $name ); |
|
387 | + return $this->createSubClient('catalog/' . $type, $name); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | |
@@ -406,9 +406,9 @@ discard block |
||
406 | 406 | * @since 2016.01 |
407 | 407 | * @category Developer |
408 | 408 | */ |
409 | - $domains = array( 'media', 'text' ); |
|
409 | + $domains = array('media', 'text'); |
|
410 | 410 | |
411 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/domains', $domains ); |
|
411 | + return $this->getContext()->getConfig()->get('admin/jqadm/catalog/domains', $domains); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | |
@@ -419,11 +419,11 @@ discard block |
||
419 | 419 | */ |
420 | 420 | protected function getRootId() |
421 | 421 | { |
422 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog' ); |
|
422 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog'); |
|
423 | 423 | |
424 | 424 | try { |
425 | - return $manager->getTree( null, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE )->getId(); |
|
426 | - } catch( \Exception $e ) { |
|
425 | + return $manager->getTree(null, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE)->getId(); |
|
426 | + } catch (\Exception $e) { |
|
427 | 427 | return null; |
428 | 428 | } |
429 | 429 | } |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | * @since 2016.01 |
470 | 470 | * @category Developer |
471 | 471 | */ |
472 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/catalog/standard/subparts', [] ); |
|
472 | + return $this->getContext()->getConfig()->get('admin/jqadm/catalog/standard/subparts', []); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | |
@@ -479,33 +479,33 @@ discard block |
||
479 | 479 | * @param string[] Data array |
480 | 480 | * @return \Aimeos\MShop\Catalog\Item\Iface New catalog item object |
481 | 481 | */ |
482 | - protected function fromArray( array $data ) |
|
482 | + protected function fromArray(array $data) |
|
483 | 483 | { |
484 | 484 | $conf = []; |
485 | 485 | |
486 | - if( isset( $data['config']['key'] ) ) |
|
486 | + if (isset($data['config']['key'])) |
|
487 | 487 | { |
488 | - foreach( (array) $data['config']['key'] as $idx => $key ) |
|
488 | + foreach ((array) $data['config']['key'] as $idx => $key) |
|
489 | 489 | { |
490 | - if( trim( $key ) !== '' && isset( $data['config']['val'][$idx] ) ) { |
|
490 | + if (trim($key) !== '' && isset($data['config']['val'][$idx])) { |
|
491 | 491 | $conf[$key] = $data['config']['val'][$idx]; |
492 | 492 | } |
493 | 493 | } |
494 | 494 | } |
495 | 495 | |
496 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'catalog' ); |
|
496 | + $manager = \Aimeos\MShop::create($this->getContext(), 'catalog'); |
|
497 | 497 | |
498 | - if( isset( $data['catalog.id'] ) && $data['catalog.id'] != '' ) { |
|
499 | - $item = $manager->getItem( $data['catalog.id'], $this->getDomains() ); |
|
498 | + if (isset($data['catalog.id']) && $data['catalog.id'] != '') { |
|
499 | + $item = $manager->getItem($data['catalog.id'], $this->getDomains()); |
|
500 | 500 | } else { |
501 | 501 | $item = $manager->createItem(); |
502 | 502 | } |
503 | 503 | |
504 | - $item->fromArray( $data ); |
|
505 | - $item->setConfig( $conf ); |
|
504 | + $item->fromArray($data); |
|
505 | + $item->setConfig($conf); |
|
506 | 506 | |
507 | - if( $item->getId() == null ) { |
|
508 | - return $manager->insertItem( $item, $data['catalog.parentid'] ?: null ); |
|
507 | + if ($item->getId() == null) { |
|
508 | + return $manager->insertItem($item, $data['catalog.parentid'] ?: null); |
|
509 | 509 | } |
510 | 510 | |
511 | 511 | return $item; |
@@ -518,19 +518,19 @@ discard block |
||
518 | 518 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item object |
519 | 519 | * @return string[] Multi-dimensional associative list of item data |
520 | 520 | */ |
521 | - protected function toArray( \Aimeos\MShop\Catalog\Item\Iface $item, $copy = false ) |
|
521 | + protected function toArray(\Aimeos\MShop\Catalog\Item\Iface $item, $copy = false) |
|
522 | 522 | { |
523 | - $data = $item->toArray( true ); |
|
523 | + $data = $item->toArray(true); |
|
524 | 524 | $data['config'] = []; |
525 | 525 | |
526 | - if( $copy === true ) |
|
526 | + if ($copy === true) |
|
527 | 527 | { |
528 | 528 | $data['catalog.id'] = ''; |
529 | 529 | $data['catalog.siteid'] = $item->getSiteId(); |
530 | 530 | $data['catalog.code'] = $data['catalog.code'] . '_copy'; |
531 | 531 | } |
532 | 532 | |
533 | - foreach( $item->getConfig() as $key => $value ) |
|
533 | + foreach ($item->getConfig() as $key => $value) |
|
534 | 534 | { |
535 | 535 | $data['config']['key'][] = $key; |
536 | 536 | $data['config']['val'][] = $value; |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
547 | 547 | * @return string HTML output |
548 | 548 | */ |
549 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
549 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
550 | 550 | { |
551 | 551 | /** admin/jqadm/catalog/template-item |
552 | 552 | * Relative path to the HTML body template for the catalog item. |
@@ -570,6 +570,6 @@ discard block |
||
570 | 570 | $tplconf = 'admin/jqadm/catalog/template-item'; |
571 | 571 | $default = 'catalog/item-standard'; |
572 | 572 | |
573 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
573 | + return $view->render($view->config($tplconf, $default)); |
|
574 | 574 | } |
575 | 575 | } |
@@ -52,14 +52,12 @@ discard block |
||
52 | 52 | $view->tabindex = ++$idx + 1; |
53 | 53 | $view->itemBody .= $client->copy(); |
54 | 54 | } |
55 | - } |
|
56 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + } catch( \Aimeos\MShop\Exception $e ) |
|
57 | 56 | { |
58 | 57 | $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
59 | 58 | $view->errors = $view->get( 'errors', [] ) + $error; |
60 | 59 | $this->logException( $e ); |
61 | - } |
|
62 | - catch( \Exception $e ) |
|
60 | + } catch( \Exception $e ) |
|
63 | 61 | { |
64 | 62 | $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
65 | 63 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -101,14 +99,12 @@ discard block |
||
101 | 99 | $view->tabindex = ++$idx + 1; |
102 | 100 | $view->itemBody .= $client->create(); |
103 | 101 | } |
104 | - } |
|
105 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + } catch( \Aimeos\MShop\Exception $e ) |
|
106 | 103 | { |
107 | 104 | $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
108 | 105 | $view->errors = $view->get( 'errors', [] ) + $error; |
109 | 106 | $this->logException( $e ); |
110 | - } |
|
111 | - catch( \Exception $e ) |
|
107 | + } catch( \Exception $e ) |
|
112 | 108 | { |
113 | 109 | $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
114 | 110 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -150,14 +146,12 @@ discard block |
||
150 | 146 | |
151 | 147 | $this->nextAction( $view, 'search', 'catalog', null, 'delete' ); |
152 | 148 | return; |
153 | - } |
|
154 | - catch( \Aimeos\MShop\Exception $e ) |
|
149 | + } catch( \Aimeos\MShop\Exception $e ) |
|
155 | 150 | { |
156 | 151 | $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
157 | 152 | $view->errors = $view->get( 'errors', [] ) + $error; |
158 | 153 | $this->logException( $e ); |
159 | - } |
|
160 | - catch( \Exception $e ) |
|
154 | + } catch( \Exception $e ) |
|
161 | 155 | { |
162 | 156 | $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
163 | 157 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -199,14 +193,12 @@ discard block |
||
199 | 193 | $view->tabindex = ++$idx + 1; |
200 | 194 | $view->itemBody .= $client->get(); |
201 | 195 | } |
202 | - } |
|
203 | - catch( \Aimeos\MShop\Exception $e ) |
|
196 | + } catch( \Aimeos\MShop\Exception $e ) |
|
204 | 197 | { |
205 | 198 | $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
206 | 199 | $view->errors = $view->get( 'errors', [] ) + $error; |
207 | 200 | $this->logException( $e ); |
208 | - } |
|
209 | - catch( \Exception $e ) |
|
201 | + } catch( \Exception $e ) |
|
210 | 202 | { |
211 | 203 | $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
212 | 204 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -245,18 +237,15 @@ discard block |
||
245 | 237 | |
246 | 238 | $this->nextAction( $view, $view->param( 'next' ), 'catalog', $view->item->getId(), 'save' ); |
247 | 239 | return; |
248 | - } |
|
249 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
240 | + } catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
250 | 241 | { |
251 | 242 | // fall through to create |
252 | - } |
|
253 | - catch( \Aimeos\MShop\Exception $e ) |
|
243 | + } catch( \Aimeos\MShop\Exception $e ) |
|
254 | 244 | { |
255 | 245 | $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
256 | 246 | $view->errors = $view->get( 'errors', [] ) + $error; |
257 | 247 | $this->logException( $e ); |
258 | - } |
|
259 | - catch( \Exception $e ) |
|
248 | + } catch( \Exception $e ) |
|
260 | 249 | { |
261 | 250 | $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
262 | 251 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -284,14 +273,12 @@ discard block |
||
284 | 273 | $view->item = \Aimeos\MShop::create( $context, 'catalog' )->createItem(); |
285 | 274 | $view->itemRootId = $this->getRootId(); |
286 | 275 | $view->itemBody = ''; |
287 | - } |
|
288 | - catch( \Aimeos\MShop\Exception $e ) |
|
276 | + } catch( \Aimeos\MShop\Exception $e ) |
|
289 | 277 | { |
290 | 278 | $error = array( 'catalog-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
291 | 279 | $view->errors = $view->get( 'errors', [] ) + $error; |
292 | 280 | $this->logException( $e ); |
293 | - } |
|
294 | - catch( \Exception $e ) |
|
281 | + } catch( \Exception $e ) |
|
295 | 282 | { |
296 | 283 | $error = array( 'catalog-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
297 | 284 | $view->errors = $view->get( 'errors', [] ) + $error; |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->suggestData = $this->toArray( $view->item, true ); |
|
45 | + $view->suggestData = $this->toArray($view->item, true); |
|
46 | 46 | $view->suggestBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->suggestBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'related/suggest', [] ); |
|
65 | + $data = $view->param('related/suggest', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->suggestData = $data; |
72 | 72 | $view->suggestBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->suggestBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->suggestData = $this->toArray( $view->item ); |
|
91 | + $view->suggestData = $this->toArray($view->item); |
|
92 | 92 | $view->suggestBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->suggestBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'related/suggest', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('related/suggest', [])); |
|
110 | 110 | $view->suggestBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->suggestBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/related/suggest/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/related/suggest/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/related/suggest/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/related/suggest/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/related/suggest/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2016.01 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/related/suggest/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/related/suggest/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'suggestion' ); |
|
259 | - $listItems = $item->getListItems( 'product', 'suggestion', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('suggestion'); |
|
259 | + $listItems = $item->getListItems('product', 'suggestion', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'product', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('product', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $data = []; |
290 | 290 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
291 | 291 | |
292 | - foreach( $item->getListItems( 'product', 'suggestion', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('product', 'suggestion', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/related/suggest/template-item |
324 | 324 | * Relative path to the HTML body template of the suggest related subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/related/suggest/template-item'; |
343 | 343 | $default = 'product/item-related-suggest-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->boughtData = $this->toArray( $view->item, true ); |
|
45 | + $view->boughtData = $this->toArray($view->item, true); |
|
46 | 46 | $view->boughtBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->boughtBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'related/bought', [] ); |
|
65 | + $data = $view->param('related/bought', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->boughtData = $data; |
72 | 72 | $view->boughtBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->boughtBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->boughtData = $this->toArray( $view->item ); |
|
91 | + $view->boughtData = $this->toArray($view->item); |
|
92 | 92 | $view->boughtBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->boughtBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'related/bought', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('related/bought', [])); |
|
110 | 110 | $view->boughtBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->boughtBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/related/bought/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/related/bought/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/related/bought/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/related/bought/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/related/bought/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2016.01 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/related/bought/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/related/bought/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'bought-together' ); |
|
259 | - $listItems = $item->getListItems( 'product', 'bought-together', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('bought-together'); |
|
259 | + $listItems = $item->getListItems('product', 'bought-together', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'product', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('product', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $data = []; |
290 | 290 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
291 | 291 | |
292 | - foreach( $item->getListItems( 'product', 'bought-together', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('product', 'bought-together', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/related/bought/template-item |
324 | 324 | * Relative path to the HTML body template of the bought related subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/related/bought/template-item'; |
343 | 343 | $default = 'product/item-related-bought-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->customData = $this->toArray( $view->item, true ); |
|
45 | + $view->customData = $this->toArray($view->item, true); |
|
46 | 46 | $view->customBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->customBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'option/custom', [] ); |
|
65 | + $data = $view->param('option/custom', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->customData = $data; |
72 | 72 | $view->customBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->customBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->customData = $this->toArray( $view->item ); |
|
91 | + $view->customData = $this->toArray($view->item); |
|
92 | 92 | $view->customBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->customBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'option/custom', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('option/custom', [])); |
|
110 | 110 | $view->customBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->customBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/option/custom/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/option/custom/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/option/custom/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/option/custom/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/option/custom/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2017.03 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/option/custom/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/option/custom/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'custom' ); |
|
259 | - $listItems = $item->getListItems( 'attribute', 'custom', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('custom'); |
|
259 | + $listItems = $item->getListItems('attribute', 'custom', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'attribute', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('attribute', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $data = []; |
290 | 290 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
291 | 291 | |
292 | - foreach( $item->getListItems( 'attribute', 'custom', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('attribute', 'custom', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/option/custom/template-item |
324 | 324 | * Relative path to the HTML body template of the custom option subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/option/custom/template-item'; |
343 | 343 | $default = 'product/item-option-custom-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->configData = $this->toArray( $view->item, true ); |
|
45 | + $view->configData = $this->toArray($view->item, true); |
|
46 | 46 | $view->configBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->configBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'option/config', [] ); |
|
65 | + $data = $view->param('option/config', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->configData = $data; |
72 | 72 | $view->configBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->configBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->configData = $this->toArray( $view->item ); |
|
91 | + $view->configData = $this->toArray($view->item); |
|
92 | 92 | $view->configBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->configBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'option/config', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('option/config', [])); |
|
110 | 110 | $view->configBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->configBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/option/config/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/option/config/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/option/config/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/option/config/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/option/config/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2017.03 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/option/config/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/option/config/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,31 +251,31 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'config' ); |
|
259 | - $listItems = $item->getListItems( 'attribute', 'config', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('config'); |
|
259 | + $listItems = $item->getListItems('attribute', 'config', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'attribute', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('attribute', $litem, $litem->getRefItem()); |
|
274 | 274 | |
275 | 275 | |
276 | 276 | } |
277 | 277 | |
278 | - return $item->deleteListItems( $listItems ); |
|
278 | + return $item->deleteListItems($listItems); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -286,26 +286,26 @@ discard block |
||
286 | 286 | * @param boolean $copy True if items should be copied, false if not |
287 | 287 | * @return string[] Multi-dimensional associative list of item data |
288 | 288 | */ |
289 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
289 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
290 | 290 | { |
291 | 291 | $data = []; |
292 | 292 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
293 | 293 | |
294 | - foreach( $item->getListItems( 'attribute', 'config', null, false ) as $listItem ) |
|
294 | + foreach ($item->getListItems('attribute', 'config', null, false) as $listItem) |
|
295 | 295 | { |
296 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
296 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
297 | 297 | continue; |
298 | 298 | } |
299 | 299 | |
300 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
300 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
301 | 301 | |
302 | - if( $copy === true ) |
|
302 | + if ($copy === true) |
|
303 | 303 | { |
304 | 304 | $list['product.lists.siteid'] = $siteId; |
305 | 305 | $list['product.lists.id'] = ''; |
306 | 306 | } |
307 | 307 | |
308 | - foreach( $list as $key => $value ) { |
|
308 | + foreach ($list as $key => $value) { |
|
309 | 309 | $data[$key][] = $value; |
310 | 310 | } |
311 | 311 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
321 | 321 | * @return string HTML output |
322 | 322 | */ |
323 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
323 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
324 | 324 | { |
325 | 325 | /** admin/jqadm/product/option/config/template-item |
326 | 326 | * Relative path to the HTML body template of the config option subpart for products. |
@@ -344,6 +344,6 @@ discard block |
||
344 | 344 | $tplconf = 'admin/jqadm/product/option/config/template-item'; |
345 | 345 | $default = 'product/item-option-config-standard'; |
346 | 346 | |
347 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
347 | + return $view->render($view->config($tplconf, $default)); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | \ No newline at end of file |