@@ -18,36 +18,36 @@ discard block |
||
18 | 18 | |
19 | 19 | public static function setUpBeforeClass() |
20 | 20 | { |
21 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( \TestHelperCntl::getContext() ); |
|
21 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create(\TestHelperCntl::getContext()); |
|
22 | 22 | |
23 | 23 | $item = $manager->createItem(); |
24 | - $item->setCode( 'job_csv_prod' ); |
|
25 | - $item->setType( 'default' ); |
|
26 | - $item->setStatus( 1 ); |
|
24 | + $item->setCode('job_csv_prod'); |
|
25 | + $item->setType('default'); |
|
26 | + $item->setStatus(1); |
|
27 | 27 | |
28 | - self::$product = $manager->saveItem( $item ); |
|
28 | + self::$product = $manager->saveItem($item); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public static function tearDownAfterClass() |
33 | 33 | { |
34 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( \TestHelperCntl::getContext() ); |
|
35 | - $manager->deleteItem( self::$product->getId() ); |
|
34 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create(\TestHelperCntl::getContext()); |
|
35 | + $manager->deleteItem(self::$product->getId()); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | protected function setUp() |
40 | 40 | { |
41 | - \Aimeos\MShop::cache( true ); |
|
41 | + \Aimeos\MShop::cache(true); |
|
42 | 42 | |
43 | 43 | $this->context = \TestHelperCntl::getContext(); |
44 | - $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] ); |
|
44 | + $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | protected function tearDown() |
49 | 49 | { |
50 | - \Aimeos\MShop::cache( false ); |
|
50 | + \Aimeos\MShop::cache(false); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -67,30 +67,30 @@ discard block |
||
67 | 67 | 3 => 'job_csv_test', |
68 | 68 | ); |
69 | 69 | |
70 | - $this->create( 'job_csv_test' ); |
|
70 | + $this->create('job_csv_test'); |
|
71 | 71 | |
72 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint ); |
|
73 | - $object->process( self::$product, $data ); |
|
72 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint); |
|
73 | + $object->process(self::$product, $data); |
|
74 | 74 | |
75 | - $category = $this->get( 'job_csv_test' ); |
|
76 | - $this->delete( $category ); |
|
75 | + $category = $this->get('job_csv_test'); |
|
76 | + $this->delete($category); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | $pos = 0; |
80 | 80 | $listItems = $category->getListItems(); |
81 | 81 | $expected = array( |
82 | - array( 'default', 'job_csv_prod' ), |
|
83 | - array( 'promotion', 'job_csv_prod' ), |
|
82 | + array('default', 'job_csv_prod'), |
|
83 | + array('promotion', 'job_csv_prod'), |
|
84 | 84 | ); |
85 | 85 | |
86 | - $this->assertEquals( 2, count( $listItems ) ); |
|
86 | + $this->assertEquals(2, count($listItems)); |
|
87 | 87 | |
88 | - foreach( $listItems as $listItem ) |
|
88 | + foreach ($listItems as $listItem) |
|
89 | 89 | { |
90 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
91 | - $this->assertEquals( 'product', $listItem->getDomain() ); |
|
92 | - $this->assertEquals( $expected[$pos][0], $listItem->getType() ); |
|
93 | - $this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getCode() ); |
|
90 | + $this->assertEquals(1, $listItem->getStatus()); |
|
91 | + $this->assertEquals('product', $listItem->getDomain()); |
|
92 | + $this->assertEquals($expected[$pos][0], $listItem->getType()); |
|
93 | + $this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getCode()); |
|
94 | 94 | $pos++; |
95 | 95 | } |
96 | 96 | } |
@@ -112,32 +112,32 @@ discard block |
||
112 | 112 | 3 => "job_csv_test\njob_csv_test2", |
113 | 113 | ); |
114 | 114 | |
115 | - $this->create( 'job_csv_test' ); |
|
116 | - $this->create( 'job_csv_test2' ); |
|
115 | + $this->create('job_csv_test'); |
|
116 | + $this->create('job_csv_test2'); |
|
117 | 117 | |
118 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint ); |
|
119 | - $object->process( self::$product, $data ); |
|
118 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint); |
|
119 | + $object->process(self::$product, $data); |
|
120 | 120 | |
121 | - $category = $this->get( 'job_csv_test' ); |
|
122 | - $category2 = $this->get( 'job_csv_test2' ); |
|
121 | + $category = $this->get('job_csv_test'); |
|
122 | + $category2 = $this->get('job_csv_test2'); |
|
123 | 123 | |
124 | - $this->delete( $category ); |
|
125 | - $this->delete( $category2 ); |
|
124 | + $this->delete($category); |
|
125 | + $this->delete($category2); |
|
126 | 126 | |
127 | 127 | |
128 | 128 | $pos = 0; |
129 | - $types = array( 'default', 'promotion', 'default', 'promotion' ); |
|
129 | + $types = array('default', 'promotion', 'default', 'promotion'); |
|
130 | 130 | |
131 | - foreach( array( $category->getListItems(), $category2->getListItems() ) as $listItems ) |
|
131 | + foreach (array($category->getListItems(), $category2->getListItems()) as $listItems) |
|
132 | 132 | { |
133 | - $this->assertEquals( 2, count( $listItems ) ); |
|
133 | + $this->assertEquals(2, count($listItems)); |
|
134 | 134 | |
135 | - foreach( $listItems as $listItem ) |
|
135 | + foreach ($listItems as $listItem) |
|
136 | 136 | { |
137 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
138 | - $this->assertEquals( 'product', $listItem->getDomain() ); |
|
139 | - $this->assertEquals( $types[$pos], $listItem->getType() ); |
|
140 | - $this->assertEquals( 'job_csv_prod', $listItem->getRefItem()->getCode() ); |
|
137 | + $this->assertEquals(1, $listItem->getStatus()); |
|
138 | + $this->assertEquals('product', $listItem->getDomain()); |
|
139 | + $this->assertEquals($types[$pos], $listItem->getType()); |
|
140 | + $this->assertEquals('job_csv_prod', $listItem->getRefItem()->getCode()); |
|
141 | 141 | $pos++; |
142 | 142 | } |
143 | 143 | } |
@@ -161,23 +161,23 @@ discard block |
||
161 | 161 | 1 => 'job_csv_test', |
162 | 162 | ); |
163 | 163 | |
164 | - $this->create( 'job_csv_test' ); |
|
164 | + $this->create('job_csv_test'); |
|
165 | 165 | |
166 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint ); |
|
167 | - $object->process( self::$product, $data ); |
|
168 | - $object->process( self::$product, $dataUpdate ); |
|
166 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint); |
|
167 | + $object->process(self::$product, $data); |
|
168 | + $object->process(self::$product, $dataUpdate); |
|
169 | 169 | |
170 | - $category = $this->get( 'job_csv_test' ); |
|
171 | - $this->delete( $category ); |
|
170 | + $category = $this->get('job_csv_test'); |
|
171 | + $this->delete($category); |
|
172 | 172 | |
173 | 173 | |
174 | 174 | $listItems = $category->getListItems(); |
175 | - $listItem = reset( $listItems ); |
|
175 | + $listItem = reset($listItems); |
|
176 | 176 | |
177 | - $this->assertEquals( 1, count( $listItems ) ); |
|
178 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
177 | + $this->assertEquals(1, count($listItems)); |
|
178 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
179 | 179 | |
180 | - $this->assertEquals( 'job_csv_prod', $listItem->getRefItem()->getCode() ); |
|
180 | + $this->assertEquals('job_csv_prod', $listItem->getRefItem()->getCode()); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | |
@@ -193,21 +193,21 @@ discard block |
||
193 | 193 | 1 => 'job_csv_test', |
194 | 194 | ); |
195 | 195 | |
196 | - $this->create( 'job_csv_test' ); |
|
196 | + $this->create('job_csv_test'); |
|
197 | 197 | |
198 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint ); |
|
199 | - $object->process( self::$product, $data ); |
|
198 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint); |
|
199 | + $object->process(self::$product, $data); |
|
200 | 200 | |
201 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, [], $this->endpoint ); |
|
202 | - $object->process( self::$product, [] ); |
|
201 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, [], $this->endpoint); |
|
202 | + $object->process(self::$product, []); |
|
203 | 203 | |
204 | - $category = $this->get( 'job_csv_test' ); |
|
205 | - $this->delete( $category ); |
|
204 | + $category = $this->get('job_csv_test'); |
|
205 | + $this->delete($category); |
|
206 | 206 | |
207 | 207 | |
208 | 208 | $listItems = $category->getListItems(); |
209 | 209 | |
210 | - $this->assertEquals( 0, count( $listItems ) ); |
|
210 | + $this->assertEquals(0, count($listItems)); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | |
@@ -227,18 +227,18 @@ discard block |
||
227 | 227 | 3 => 'job_csv_test', |
228 | 228 | ); |
229 | 229 | |
230 | - $this->create( 'job_csv_test' ); |
|
230 | + $this->create('job_csv_test'); |
|
231 | 231 | |
232 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint ); |
|
233 | - $object->process( self::$product, $data ); |
|
232 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint); |
|
233 | + $object->process(self::$product, $data); |
|
234 | 234 | |
235 | - $category = $this->get( 'job_csv_test' ); |
|
236 | - $this->delete( $category ); |
|
235 | + $category = $this->get('job_csv_test'); |
|
236 | + $this->delete($category); |
|
237 | 237 | |
238 | 238 | |
239 | 239 | $listItems = $category->getListItems(); |
240 | 240 | |
241 | - $this->assertEquals( 1, count( $listItems ) ); |
|
241 | + $this->assertEquals(1, count($listItems)); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | |
@@ -258,60 +258,60 @@ discard block |
||
258 | 258 | 3 => 'job_csv_test', |
259 | 259 | ); |
260 | 260 | |
261 | - $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/catalog/listtypes', array( 'default' ) ); |
|
261 | + $this->context->getConfig()->set('controller/common/product/import/csv/processor/catalog/listtypes', array('default')); |
|
262 | 262 | |
263 | - $this->create( 'job_csv_test' ); |
|
263 | + $this->create('job_csv_test'); |
|
264 | 264 | |
265 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint ); |
|
265 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint); |
|
266 | 266 | |
267 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
268 | - $object->process( self::$product, $data ); |
|
267 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
268 | + $object->process(self::$product, $data); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | |
272 | 272 | /** |
273 | 273 | * @param string $code |
274 | 274 | */ |
275 | - protected function create( $code ) |
|
275 | + protected function create($code) |
|
276 | 276 | { |
277 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context ); |
|
277 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context); |
|
278 | 278 | |
279 | 279 | $item = $manager->createItem(); |
280 | - $item->setCode( $code ); |
|
280 | + $item->setCode($code); |
|
281 | 281 | |
282 | - $manager->insertItem( $item ); |
|
282 | + $manager->insertItem($item); |
|
283 | 283 | |
284 | 284 | return $item; |
285 | 285 | } |
286 | 286 | |
287 | 287 | |
288 | - protected function delete( \Aimeos\MShop\Catalog\Item\Iface $catItem ) |
|
288 | + protected function delete(\Aimeos\MShop\Catalog\Item\Iface $catItem) |
|
289 | 289 | { |
290 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context ); |
|
291 | - $listManager = $manager->getSubManager( 'lists' ); |
|
290 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context); |
|
291 | + $listManager = $manager->getSubManager('lists'); |
|
292 | 292 | |
293 | - foreach( $catItem->getListItems('product') as $listItem ) { |
|
294 | - $listManager->deleteItem( $listItem->getId() ); |
|
293 | + foreach ($catItem->getListItems('product') as $listItem) { |
|
294 | + $listManager->deleteItem($listItem->getId()); |
|
295 | 295 | } |
296 | 296 | |
297 | - $manager->deleteItem( $catItem->getId() ); |
|
297 | + $manager->deleteItem($catItem->getId()); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
301 | 301 | /** |
302 | 302 | * @param string $code |
303 | 303 | */ |
304 | - protected function get( $code ) |
|
304 | + protected function get($code) |
|
305 | 305 | { |
306 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context ); |
|
306 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context); |
|
307 | 307 | |
308 | 308 | $search = $manager->createSearch(); |
309 | - $search->setConditions( $search->compare( '==', 'catalog.code', $code ) ); |
|
309 | + $search->setConditions($search->compare('==', 'catalog.code', $code)); |
|
310 | 310 | |
311 | - $result = $manager->searchItems( $search, array('product') ); |
|
311 | + $result = $manager->searchItems($search, array('product')); |
|
312 | 312 | |
313 | - if( ( $item = reset( $result ) ) === false ) { |
|
314 | - throw new \RuntimeException( sprintf( 'No catalog item for code "%1$s"', $code ) ); |
|
313 | + if (($item = reset($result)) === false) { |
|
314 | + throw new \RuntimeException(sprintf('No catalog item for code "%1$s"', $code)); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | return $item; |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | |
19 | 19 | protected function setUp() |
20 | 20 | { |
21 | - \Aimeos\MShop::cache( true ); |
|
21 | + \Aimeos\MShop::cache(true); |
|
22 | 22 | |
23 | 23 | $this->context = \TestHelperCntl::getContext(); |
24 | - $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] ); |
|
24 | + $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []); |
|
25 | 25 | |
26 | - $manager = \Aimeos\MShop::create( $this->context, 'product' ); |
|
26 | + $manager = \Aimeos\MShop::create($this->context, 'product'); |
|
27 | 27 | $search = $manager->createSearch(); |
28 | - $search->setConditions( $search->compare( '==', 'product.code', ['CNC', 'CNE'] ) ); |
|
28 | + $search->setConditions($search->compare('==', 'product.code', ['CNC', 'CNE'])); |
|
29 | 29 | |
30 | 30 | $this->products = []; |
31 | - foreach( $manager->searchItems( $search ) as $id => $item ) { |
|
31 | + foreach ($manager->searchItems($search) as $id => $item) { |
|
32 | 32 | $this->products[$item->getCode()] = $id; |
33 | 33 | } |
34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | protected function tearDown() |
38 | 38 | { |
39 | - \Aimeos\MShop::cache( false ); |
|
39 | + \Aimeos\MShop::cache(false); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -56,23 +56,23 @@ discard block |
||
56 | 56 | 3 => 'CNE', |
57 | 57 | ); |
58 | 58 | |
59 | - $product = $this->create( 'job_csv_test' ); |
|
59 | + $product = $this->create('job_csv_test'); |
|
60 | 60 | |
61 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint ); |
|
62 | - $object->process( $product, $data ); |
|
61 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint); |
|
62 | + $object->process($product, $data); |
|
63 | 63 | |
64 | 64 | |
65 | - $listItems1 = $product->getListItems( 'product', 'default' ); |
|
66 | - $listItems2 = $product->getListItems( 'product', 'suggestion' ); |
|
65 | + $listItems1 = $product->getListItems('product', 'default'); |
|
66 | + $listItems2 = $product->getListItems('product', 'suggestion'); |
|
67 | 67 | |
68 | - $this->assertEquals( 1, count( $listItems1 ) ); |
|
69 | - $this->assertEquals( 1, count( $listItems2 ) ); |
|
68 | + $this->assertEquals(1, count($listItems1)); |
|
69 | + $this->assertEquals(1, count($listItems2)); |
|
70 | 70 | |
71 | - $this->assertEquals( 1, reset( $listItems1 )->getStatus() ); |
|
72 | - $this->assertEquals( 1, reset( $listItems2 )->getStatus() ); |
|
71 | + $this->assertEquals(1, reset($listItems1)->getStatus()); |
|
72 | + $this->assertEquals(1, reset($listItems2)->getStatus()); |
|
73 | 73 | |
74 | - $this->assertEquals( $this->products['CNC'], reset( $listItems1 )->getRefId() ); |
|
75 | - $this->assertEquals( $this->products['CNE'], reset( $listItems2 )->getRefId() ); |
|
74 | + $this->assertEquals($this->products['CNC'], reset($listItems1)->getRefId()); |
|
75 | + $this->assertEquals($this->products['CNE'], reset($listItems2)->getRefId()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
@@ -88,24 +88,24 @@ discard block |
||
88 | 88 | 1 => "CNC\nCNE", |
89 | 89 | ); |
90 | 90 | |
91 | - $product = $this->create( 'job_csv_test' ); |
|
91 | + $product = $this->create('job_csv_test'); |
|
92 | 92 | |
93 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint ); |
|
94 | - $object->process( $product, $data ); |
|
93 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint); |
|
94 | + $object->process($product, $data); |
|
95 | 95 | |
96 | 96 | |
97 | 97 | $pos = 0; |
98 | 98 | $listItems = $product->getListItems(); |
99 | - $prodIds = array( $this->products['CNC'], $this->products['CNE'] ); |
|
99 | + $prodIds = array($this->products['CNC'], $this->products['CNE']); |
|
100 | 100 | |
101 | - $this->assertEquals( 2, count( $listItems ) ); |
|
101 | + $this->assertEquals(2, count($listItems)); |
|
102 | 102 | |
103 | - foreach( $listItems as $listItem ) |
|
103 | + foreach ($listItems as $listItem) |
|
104 | 104 | { |
105 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
106 | - $this->assertEquals( 'product', $listItem->getDomain() ); |
|
107 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
108 | - $this->assertEquals( $prodIds[$pos], $listItem->getRefId() ); |
|
105 | + $this->assertEquals(1, $listItem->getStatus()); |
|
106 | + $this->assertEquals('product', $listItem->getDomain()); |
|
107 | + $this->assertEquals('default', $listItem->getType()); |
|
108 | + $this->assertEquals($prodIds[$pos], $listItem->getRefId()); |
|
109 | 109 | $pos++; |
110 | 110 | } |
111 | 111 | } |
@@ -128,20 +128,20 @@ discard block |
||
128 | 128 | 1 => 'CNE', |
129 | 129 | ); |
130 | 130 | |
131 | - $product = $this->create( 'job_csv_test' ); |
|
131 | + $product = $this->create('job_csv_test'); |
|
132 | 132 | |
133 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint ); |
|
134 | - $object->process( $product, $data ); |
|
135 | - $object->process( $product, $dataUpdate ); |
|
133 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint); |
|
134 | + $object->process($product, $data); |
|
135 | + $object->process($product, $dataUpdate); |
|
136 | 136 | |
137 | 137 | |
138 | 138 | $listItems = $product->getListItems(); |
139 | - $listItem = reset( $listItems ); |
|
139 | + $listItem = reset($listItems); |
|
140 | 140 | |
141 | - $this->assertEquals( 1, count( $listItems ) ); |
|
142 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
141 | + $this->assertEquals(1, count($listItems)); |
|
142 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
143 | 143 | |
144 | - $this->assertEquals( $this->products['CNE'], $listItem->getRefId() ); |
|
144 | + $this->assertEquals($this->products['CNE'], $listItem->getRefId()); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | |
@@ -157,16 +157,16 @@ discard block |
||
157 | 157 | 1 => 'CNC', |
158 | 158 | ); |
159 | 159 | |
160 | - $product = $this->create( 'job_csv_test' ); |
|
160 | + $product = $this->create('job_csv_test'); |
|
161 | 161 | |
162 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint ); |
|
163 | - $object->process( $product, $data ); |
|
162 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint); |
|
163 | + $object->process($product, $data); |
|
164 | 164 | |
165 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, [], $this->endpoint ); |
|
166 | - $object->process( $product, [] ); |
|
165 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, [], $this->endpoint); |
|
166 | + $object->process($product, []); |
|
167 | 167 | |
168 | 168 | |
169 | - $this->assertEquals( 0, count( $product->getListItems() ) ); |
|
169 | + $this->assertEquals(0, count($product->getListItems())); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
@@ -186,15 +186,15 @@ discard block |
||
186 | 186 | 3 => 'CNE', |
187 | 187 | ); |
188 | 188 | |
189 | - $product = $this->create( 'job_csv_test' ); |
|
189 | + $product = $this->create('job_csv_test'); |
|
190 | 190 | |
191 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint ); |
|
192 | - $object->process( $product, $data ); |
|
191 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint); |
|
192 | + $object->process($product, $data); |
|
193 | 193 | |
194 | 194 | |
195 | 195 | $listItems = $product->getListItems(); |
196 | 196 | |
197 | - $this->assertEquals( 1, count( $listItems ) ); |
|
197 | + $this->assertEquals(1, count($listItems)); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
@@ -214,23 +214,23 @@ discard block |
||
214 | 214 | 3 => 'CNE', |
215 | 215 | ); |
216 | 216 | |
217 | - $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/product/listtypes', array( 'default' ) ); |
|
217 | + $this->context->getConfig()->set('controller/common/product/import/csv/processor/product/listtypes', array('default')); |
|
218 | 218 | |
219 | - $product = $this->create( 'job_csv_test' ); |
|
219 | + $product = $this->create('job_csv_test'); |
|
220 | 220 | |
221 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint ); |
|
221 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint); |
|
222 | 222 | |
223 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
224 | - $object->process( $product, $data ); |
|
223 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
224 | + $object->process($product, $data); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | |
228 | 228 | /** |
229 | 229 | * @param string $code |
230 | 230 | */ |
231 | - protected function create( $code ) |
|
231 | + protected function create($code) |
|
232 | 232 | { |
233 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context ); |
|
234 | - return $manager->createItem()->setCode( $code ); |
|
233 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context); |
|
234 | + return $manager->createItem()->setCode($code); |
|
235 | 235 | } |
236 | 236 | } |
@@ -16,48 +16,48 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - \Aimeos\MShop::cache( true ); |
|
19 | + \Aimeos\MShop::cache(true); |
|
20 | 20 | |
21 | 21 | $context = \TestHelperCntl::getContext(); |
22 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Attribute\Standard( $context ); |
|
22 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Attribute\Standard($context); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - \Aimeos\MShop::cache( false ); |
|
28 | + \Aimeos\MShop::cache(false); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testGet() |
33 | 33 | { |
34 | - $item = $this->object->get( 'black', 'color' ); |
|
34 | + $item = $this->object->get('black', 'color'); |
|
35 | 35 | |
36 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
37 | - $this->assertEquals( 'black', $item->getCode() ); |
|
38 | - $this->assertEquals( 'color', $item->getType() ); |
|
36 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
37 | + $this->assertEquals('black', $item->getCode()); |
|
38 | + $this->assertEquals('color', $item->getType()); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testGetUnknown() |
43 | 43 | { |
44 | - $this->assertEquals( null, $this->object->get( 'cache-test', 'color' ) ); |
|
44 | + $this->assertEquals(null, $this->object->get('cache-test', 'color')); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testSet() |
49 | 49 | { |
50 | - $item = $this->object->get( 'black', 'color' ); |
|
50 | + $item = $this->object->get('black', 'color'); |
|
51 | 51 | |
52 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
52 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
53 | 53 | |
54 | - $item->setCode( 'cache-test' ); |
|
54 | + $item->setCode('cache-test'); |
|
55 | 55 | |
56 | - $this->object->set( $item ); |
|
57 | - $item = $this->object->get( 'cache-test', 'color' ); |
|
56 | + $this->object->set($item); |
|
57 | + $item = $this->object->get('cache-test', 'color'); |
|
58 | 58 | |
59 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item ); |
|
60 | - $this->assertEquals( 'cache-test', $item->getCode() ); |
|
61 | - $this->assertEquals( 'color', $item->getType() ); |
|
59 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Attribute\\Item\\Iface', $item); |
|
60 | + $this->assertEquals('cache-test', $item->getCode()); |
|
61 | + $this->assertEquals('color', $item->getType()); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | \ No newline at end of file |
@@ -16,43 +16,43 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - \Aimeos\MShop::cache( true ); |
|
19 | + \Aimeos\MShop::cache(true); |
|
20 | 20 | |
21 | 21 | $context = \TestHelperCntl::getContext(); |
22 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard( $context ); |
|
22 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Catalog\Standard($context); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - \Aimeos\MShop::cache( false ); |
|
28 | + \Aimeos\MShop::cache(false); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testGet() |
33 | 33 | { |
34 | - $result = $this->object->get( 'root' ); |
|
34 | + $result = $this->object->get('root'); |
|
35 | 35 | |
36 | - $this->assertNotEquals( null, $result ); |
|
37 | - $this->assertInternalType( 'integer', $result ); |
|
36 | + $this->assertNotEquals(null, $result); |
|
37 | + $this->assertInternalType('integer', $result); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testGetUnknown() |
42 | 42 | { |
43 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
43 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | 47 | public function testSet() |
48 | 48 | { |
49 | - $item = \Aimeos\MShop::create( \TestHelperCntl::getContext(), 'catalog' )->createItem(); |
|
50 | - $item->setCode( 'cache-test' ); |
|
51 | - $item->setId( 1 ); |
|
49 | + $item = \Aimeos\MShop::create(\TestHelperCntl::getContext(), 'catalog')->createItem(); |
|
50 | + $item->setCode('cache-test'); |
|
51 | + $item->setId(1); |
|
52 | 52 | |
53 | - $this->object->set( $item ); |
|
54 | - $id = $this->object->get( 'cache-test' ); |
|
53 | + $this->object->set($item); |
|
54 | + $id = $this->object->get('cache-test'); |
|
55 | 55 | |
56 | - $this->assertEquals( $item->getId(), $id ); |
|
56 | + $this->assertEquals($item->getId(), $id); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | \ No newline at end of file |
@@ -16,40 +16,40 @@ |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - \Aimeos\MShop::cache( true ); |
|
19 | + \Aimeos\MShop::cache(true); |
|
20 | 20 | |
21 | 21 | $context = \TestHelperCntl::getContext(); |
22 | - $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard( $context ); |
|
22 | + $this->object = new \Aimeos\Controller\Common\Product\Import\Csv\Cache\Product\Standard($context); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | protected function tearDown() |
27 | 27 | { |
28 | - \Aimeos\MShop::cache( false ); |
|
28 | + \Aimeos\MShop::cache(false); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | 32 | public function testGet() |
33 | 33 | { |
34 | - $this->assertNotEquals( null, $this->object->get( 'CNC' ) ); |
|
34 | + $this->assertNotEquals(null, $this->object->get('CNC')); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | |
38 | 38 | public function testGetUnknown() |
39 | 39 | { |
40 | - $this->assertEquals( null, $this->object->get( 'cache-test' ) ); |
|
40 | + $this->assertEquals(null, $this->object->get('cache-test')); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | 44 | public function testSet() |
45 | 45 | { |
46 | - $item = \Aimeos\MShop::create( \TestHelperCntl::getContext(), 'product' )->createItem(); |
|
47 | - $item->setCode( 'cache-test' ); |
|
48 | - $item->setId( 1 ); |
|
46 | + $item = \Aimeos\MShop::create(\TestHelperCntl::getContext(), 'product')->createItem(); |
|
47 | + $item->setCode('cache-test'); |
|
48 | + $item->setId(1); |
|
49 | 49 | |
50 | - $this->object->set( $item ); |
|
51 | - $id = $this->object->get( 'cache-test' ); |
|
50 | + $this->object->set($item); |
|
51 | + $id = $this->object->get('cache-test'); |
|
52 | 52 | |
53 | - $this->assertEquals( $item->getId(), $id ); |
|
53 | + $this->assertEquals($item->getId(), $id); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | \ No newline at end of file |
@@ -16,76 +16,76 @@ discard block |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - \Aimeos\MShop::cache( true ); |
|
19 | + \Aimeos\MShop::cache(true); |
|
20 | 20 | |
21 | 21 | $context = \TestHelperCntl::getContext(); |
22 | 22 | $aimeos = \TestHelperCntl::getAimeos(); |
23 | 23 | |
24 | - $this->object = new TestAbstract( $context, $aimeos ); |
|
24 | + $this->object = new TestAbstract($context, $aimeos); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - \Aimeos\MShop::cache( false ); |
|
30 | + \Aimeos\MShop::cache(false); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | public function testGetCache() |
35 | 35 | { |
36 | - $cache = $this->object->getCachePublic( 'attribute' ); |
|
36 | + $cache = $this->object->getCachePublic('attribute'); |
|
37 | 37 | |
38 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache ); |
|
38 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testGetCacheInvalidType() |
43 | 43 | { |
44 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
45 | - $this->object->getCachePublic( '$' ); |
|
44 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
45 | + $this->object->getCachePublic('$'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetCacheInvalidClass() |
50 | 50 | { |
51 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
52 | - $this->object->getCachePublic( 'unknown' ); |
|
51 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
52 | + $this->object->getCachePublic('unknown'); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | public function testGetCacheInvalidInterface() |
57 | 57 | { |
58 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
59 | - $this->object->getCachePublic( 'attribute', 'unknown' ); |
|
58 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
59 | + $this->object->getCachePublic('attribute', 'unknown'); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | public function testGetProcessors() |
64 | 64 | { |
65 | - $processor = $this->object->getProcessorsPublic( array( 'attribute' => [] ) ); |
|
65 | + $processor = $this->object->getProcessorsPublic(array('attribute' => [])); |
|
66 | 66 | |
67 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor ); |
|
67 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testGetProcessorsInvalidType() |
72 | 72 | { |
73 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
74 | - $this->object->getProcessorsPublic( array( '$' => [] ) ); |
|
73 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
74 | + $this->object->getProcessorsPublic(array('$' => [])); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testGetProcessorsInvalidClass() |
79 | 79 | { |
80 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
81 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
80 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
81 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | 85 | public function testGetProcessorsInvalidInterface() |
86 | 86 | { |
87 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
88 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
87 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
88 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | return \TestHelperCntl::getContext(); |
99 | 99 | } |
100 | 100 | |
101 | - public function getCachePublic( $type, $name = null ) |
|
101 | + public function getCachePublic($type, $name = null) |
|
102 | 102 | { |
103 | - return $this->getCache( $type, $name ); |
|
103 | + return $this->getCache($type, $name); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
107 | - public function getProcessorsPublic( array $mappings ) |
|
107 | + public function getProcessorsPublic(array $mappings) |
|
108 | 108 | { |
109 | - return $this->getProcessors( $mappings ); |
|
109 | + return $this->getProcessors($mappings); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | |
18 | 18 | protected function setUp() |
19 | 19 | { |
20 | - \Aimeos\MShop::cache( true ); |
|
20 | + \Aimeos\MShop::cache(true); |
|
21 | 21 | |
22 | 22 | $this->context = \TestHelperCntl::getContext(); |
23 | - $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] ); |
|
23 | + $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() |
28 | 28 | { |
29 | - \Aimeos\MShop::cache( false ); |
|
29 | + \Aimeos\MShop::cache(false); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
@@ -42,21 +42,21 @@ discard block |
||
42 | 42 | 1 => '2000-01-01 00:00:00', |
43 | 43 | ); |
44 | 44 | |
45 | - $product = $this->create( 'job_csv_test' ); |
|
45 | + $product = $this->create('job_csv_test'); |
|
46 | 46 | |
47 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard( $this->context, $mapping, $this->endpoint ); |
|
48 | - $object->process( $product, $data ); |
|
47 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard($this->context, $mapping, $this->endpoint); |
|
48 | + $object->process($product, $data); |
|
49 | 49 | |
50 | - $items = $this->getStockItems( $product->getCode() ); |
|
51 | - $this->delete( $product ); |
|
50 | + $items = $this->getStockItems($product->getCode()); |
|
51 | + $this->delete($product); |
|
52 | 52 | |
53 | 53 | |
54 | - $this->assertEquals( 1, count( $items ) ); |
|
54 | + $this->assertEquals(1, count($items)); |
|
55 | 55 | |
56 | - foreach( $items as $item ) |
|
56 | + foreach ($items as $item) |
|
57 | 57 | { |
58 | - $this->assertEquals( 100, $item->getStocklevel() ); |
|
59 | - $this->assertEquals( '2000-01-01 00:00:00', $item->getDateBack() ); |
|
58 | + $this->assertEquals(100, $item->getStocklevel()); |
|
59 | + $this->assertEquals('2000-01-01 00:00:00', $item->getDateBack()); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
@@ -77,19 +77,19 @@ discard block |
||
77 | 77 | 3 => '200', |
78 | 78 | ); |
79 | 79 | |
80 | - $product = $this->create( 'job_csv_test' ); |
|
80 | + $product = $this->create('job_csv_test'); |
|
81 | 81 | |
82 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard( $this->context, $mapping, $this->endpoint ); |
|
83 | - $object->process( $product, $data ); |
|
82 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard($this->context, $mapping, $this->endpoint); |
|
83 | + $object->process($product, $data); |
|
84 | 84 | |
85 | - $items = $this->getStockItems( $product->getCode() ); |
|
86 | - $this->delete( $product ); |
|
85 | + $items = $this->getStockItems($product->getCode()); |
|
86 | + $this->delete($product); |
|
87 | 87 | |
88 | 88 | |
89 | - $this->assertEquals( 2, count( $items ) ); |
|
89 | + $this->assertEquals(2, count($items)); |
|
90 | 90 | |
91 | - foreach( $items as $item ) { |
|
92 | - $this->assertEquals( 200, $item->getStocklevel() ); |
|
91 | + foreach ($items as $item) { |
|
92 | + $this->assertEquals(200, $item->getStocklevel()); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
@@ -108,21 +108,21 @@ discard block |
||
108 | 108 | 0 => '20', |
109 | 109 | ); |
110 | 110 | |
111 | - $product = $this->create( 'job_csv_test' ); |
|
111 | + $product = $this->create('job_csv_test'); |
|
112 | 112 | |
113 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard( $this->context, $mapping, $this->endpoint ); |
|
113 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard($this->context, $mapping, $this->endpoint); |
|
114 | 114 | |
115 | - $object->process( $product, $data ); |
|
116 | - $object->process( $product, $dataUpdate ); |
|
115 | + $object->process($product, $data); |
|
116 | + $object->process($product, $dataUpdate); |
|
117 | 117 | |
118 | - $items = $this->getStockItems( $product->getCode() ); |
|
119 | - $this->delete( $product ); |
|
118 | + $items = $this->getStockItems($product->getCode()); |
|
119 | + $this->delete($product); |
|
120 | 120 | |
121 | 121 | |
122 | - $item = reset( $items ); |
|
122 | + $item = reset($items); |
|
123 | 123 | |
124 | - $this->assertEquals( 1, count( $items ) ); |
|
125 | - $this->assertEquals( 20, $item->getStocklevel() ); |
|
124 | + $this->assertEquals(1, count($items)); |
|
125 | + $this->assertEquals(20, $item->getStocklevel()); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | |
@@ -136,19 +136,19 @@ discard block |
||
136 | 136 | 0 => 50, |
137 | 137 | ); |
138 | 138 | |
139 | - $product = $this->create( 'job_csv_test' ); |
|
139 | + $product = $this->create('job_csv_test'); |
|
140 | 140 | |
141 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard( $this->context, $mapping, $this->endpoint ); |
|
142 | - $object->process( $product, $data ); |
|
141 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard($this->context, $mapping, $this->endpoint); |
|
142 | + $object->process($product, $data); |
|
143 | 143 | |
144 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard( $this->context, [], $this->endpoint ); |
|
145 | - $object->process( $product, [] ); |
|
144 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard($this->context, [], $this->endpoint); |
|
145 | + $object->process($product, []); |
|
146 | 146 | |
147 | - $items = $this->getStockItems( $product->getCode() ); |
|
148 | - $this->delete( $product ); |
|
147 | + $items = $this->getStockItems($product->getCode()); |
|
148 | + $this->delete($product); |
|
149 | 149 | |
150 | 150 | |
151 | - $this->assertEquals( 0, count( $items ) ); |
|
151 | + $this->assertEquals(0, count($items)); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
@@ -166,20 +166,20 @@ discard block |
||
166 | 166 | 2 => '', |
167 | 167 | ); |
168 | 168 | |
169 | - $product = $this->create( 'job_csv_test' ); |
|
169 | + $product = $this->create('job_csv_test'); |
|
170 | 170 | |
171 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard( $this->context, $mapping, $this->endpoint ); |
|
172 | - $object->process( $product, $data ); |
|
171 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Stock\Standard($this->context, $mapping, $this->endpoint); |
|
172 | + $object->process($product, $data); |
|
173 | 173 | |
174 | - $items = $this->getStockItems( $product->getCode() ); |
|
175 | - $this->delete( $product ); |
|
174 | + $items = $this->getStockItems($product->getCode()); |
|
175 | + $this->delete($product); |
|
176 | 176 | |
177 | - $this->assertEquals( 1, count( $items ) ); |
|
177 | + $this->assertEquals(1, count($items)); |
|
178 | 178 | |
179 | - foreach( $items as $item ) |
|
179 | + foreach ($items as $item) |
|
180 | 180 | { |
181 | - $this->assertEquals( null, $item->getStocklevel() ); |
|
182 | - $this->assertEquals( null, $item->getDateBack() ); |
|
181 | + $this->assertEquals(null, $item->getStocklevel()); |
|
182 | + $this->assertEquals(null, $item->getDateBack()); |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
@@ -187,37 +187,37 @@ discard block |
||
187 | 187 | /** |
188 | 188 | * @param string $code |
189 | 189 | */ |
190 | - protected function create( $code ) |
|
190 | + protected function create($code) |
|
191 | 191 | { |
192 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context ); |
|
192 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context); |
|
193 | 193 | |
194 | 194 | $item = $manager->createItem(); |
195 | - $item->setType( 'default' ); |
|
196 | - $item->setCode( $code ); |
|
195 | + $item->setType('default'); |
|
196 | + $item->setCode($code); |
|
197 | 197 | |
198 | - return $manager->saveItem( $item ); |
|
198 | + return $manager->saveItem($item); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
202 | - protected function delete( \Aimeos\MShop\Product\Item\Iface $product ) |
|
202 | + protected function delete(\Aimeos\MShop\Product\Item\Iface $product) |
|
203 | 203 | { |
204 | - $manager = \Aimeos\MShop\Stock\Manager\Factory::create( $this->context ); |
|
204 | + $manager = \Aimeos\MShop\Stock\Manager\Factory::create($this->context); |
|
205 | 205 | $search = $manager->createSearch(); |
206 | - $search->setConditions( $search->compare( '==', 'stock.productcode', $product->getCode() ) ); |
|
207 | - $manager->deleteItems( array_keys( $manager->searchItems( $search ) ) ); |
|
206 | + $search->setConditions($search->compare('==', 'stock.productcode', $product->getCode())); |
|
207 | + $manager->deleteItems(array_keys($manager->searchItems($search))); |
|
208 | 208 | |
209 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context ); |
|
210 | - $manager->deleteItem( $product->getId() ); |
|
209 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context); |
|
210 | + $manager->deleteItem($product->getId()); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | |
214 | - protected function getStockItems( $code ) |
|
214 | + protected function getStockItems($code) |
|
215 | 215 | { |
216 | - $manager = \Aimeos\MShop::create( $this->context, 'stock' ); |
|
216 | + $manager = \Aimeos\MShop::create($this->context, 'stock'); |
|
217 | 217 | |
218 | 218 | $search = $manager->createSearch(); |
219 | - $search->setConditions( $search->compare( '==', 'stock.productcode', $code ) ); |
|
219 | + $search->setConditions($search->compare('==', 'stock.productcode', $code)); |
|
220 | 220 | |
221 | - return $manager->searchItems( $search ); |
|
221 | + return $manager->searchItems($search); |
|
222 | 222 | } |
223 | 223 | } |
224 | 224 | \ No newline at end of file |