@@ -12,13 +12,13 @@ discard block |
||
12 | 12 | { |
13 | 13 | protected function setUp() |
14 | 14 | { |
15 | - \Aimeos\MShop::cache( true ); |
|
15 | + \Aimeos\MShop::cache(true); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | |
19 | 19 | protected function tearDown() |
20 | 20 | { |
21 | - \Aimeos\MShop::cache( false ); |
|
21 | + \Aimeos\MShop::cache(false); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | |
@@ -26,29 +26,29 @@ discard block |
||
26 | 26 | { |
27 | 27 | $context = \TestHelperCntl::getContext(); |
28 | 28 | |
29 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
29 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
30 | 30 | |
31 | - $fcn = function( $subject ){ |
|
31 | + $fcn = function($subject) { |
|
32 | 32 | return $subject->getGroups() === ['1', '2']; |
33 | 33 | }; |
34 | 34 | |
35 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
36 | - ->setConstructorArgs( [$context] ) |
|
37 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
35 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
36 | + ->setConstructorArgs([$context]) |
|
37 | + ->setMethods(['getItem', 'saveItem']) |
|
38 | 38 | ->getMock(); |
39 | 39 | |
40 | - \Aimeos\MShop::inject( 'customer', $customerStub ); |
|
40 | + \Aimeos\MShop::inject('customer', $customerStub); |
|
41 | 41 | |
42 | 42 | $customerItem = $customerStub->createItem(); |
43 | 43 | |
44 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
45 | - ->will( $this->returnValue( $customerItem ) ); |
|
44 | + $customerStub->expects($this->once())->method('getItem') |
|
45 | + ->will($this->returnValue($customerItem)); |
|
46 | 46 | |
47 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
48 | - ->with( $this->callback( $fcn ) ); |
|
47 | + $customerStub->expects($this->once())->method('saveItem') |
|
48 | + ->with($this->callback($fcn)); |
|
49 | 49 | |
50 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
51 | - $object->begin( $this->getSubscription( $context ) ); |
|
50 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
51 | + $object->begin($this->getSubscription($context)); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | |
@@ -56,45 +56,45 @@ discard block |
||
56 | 56 | { |
57 | 57 | $context = \TestHelperCntl::getContext(); |
58 | 58 | |
59 | - $context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] ); |
|
59 | + $context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']); |
|
60 | 60 | |
61 | - $fcn = function( $subject ){ |
|
61 | + $fcn = function($subject) { |
|
62 | 62 | return $subject->getGroups() === []; |
63 | 63 | }; |
64 | 64 | |
65 | - $customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' ) |
|
66 | - ->setConstructorArgs( [$context] ) |
|
67 | - ->setMethods( ['getItem', 'saveItem'] ) |
|
65 | + $customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard') |
|
66 | + ->setConstructorArgs([$context]) |
|
67 | + ->setMethods(['getItem', 'saveItem']) |
|
68 | 68 | ->getMock(); |
69 | 69 | |
70 | - \Aimeos\MShop::inject( 'customer', $customerStub ); |
|
70 | + \Aimeos\MShop::inject('customer', $customerStub); |
|
71 | 71 | |
72 | - $customerItem = $customerStub->createItem()->setGroups( ['1', '2'] ); |
|
72 | + $customerItem = $customerStub->createItem()->setGroups(['1', '2']); |
|
73 | 73 | |
74 | - $customerStub->expects( $this->once() )->method( 'getItem' ) |
|
75 | - ->will( $this->returnValue( $customerItem ) ); |
|
74 | + $customerStub->expects($this->once())->method('getItem') |
|
75 | + ->will($this->returnValue($customerItem)); |
|
76 | 76 | |
77 | - $customerStub->expects( $this->once() )->method( 'saveItem' ) |
|
78 | - ->with( $this->callback( $fcn ) ); |
|
77 | + $customerStub->expects($this->once())->method('saveItem') |
|
78 | + ->with($this->callback($fcn)); |
|
79 | 79 | |
80 | - $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context ); |
|
81 | - $object->end( $this->getSubscription( $context ) ); |
|
80 | + $object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context); |
|
81 | + $object->end($this->getSubscription($context)); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | - protected function getSubscription( $context ) |
|
85 | + protected function getSubscription($context) |
|
86 | 86 | { |
87 | - $manager = \Aimeos\MShop::create( $context, 'subscription' ); |
|
87 | + $manager = \Aimeos\MShop::create($context, 'subscription'); |
|
88 | 88 | |
89 | 89 | $search = $manager->createSearch(); |
90 | - $search->setConditions( $search->compare( '==', 'subscription.dateend', '2010-01-01' ) ); |
|
90 | + $search->setConditions($search->compare('==', 'subscription.dateend', '2010-01-01')); |
|
91 | 91 | |
92 | - $items = $manager->searchItems( $search ); |
|
92 | + $items = $manager->searchItems($search); |
|
93 | 93 | |
94 | - if( ( $item = reset( $items ) ) !== false ) { |
|
94 | + if (($item = reset($items)) !== false) { |
|
95 | 95 | return $item; |
96 | 96 | } |
97 | 97 | |
98 | - throw new \Exception( 'No subscription item found' ); |
|
98 | + throw new \Exception('No subscription item found'); |
|
99 | 99 | } |
100 | 100 | } |
@@ -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\Catalog\Import\Csv\Processor\Done( $this->context, [] ); |
|
23 | + $this->endpoint = new \Aimeos\Controller\Common\Catalog\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 | |
@@ -50,32 +50,32 @@ discard block |
||
50 | 50 | 5 => 1, |
51 | 51 | ); |
52 | 52 | |
53 | - $catalog = $this->create( 'job_csv_test' ); |
|
53 | + $catalog = $this->create('job_csv_test'); |
|
54 | 54 | |
55 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
56 | - $object->process( $catalog, $data ); |
|
55 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
56 | + $object->process($catalog, $data); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | $listItems = $catalog->getListItems(); |
60 | - $listItem = reset( $listItems ); |
|
60 | + $listItem = reset($listItems); |
|
61 | 61 | |
62 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
63 | - $this->assertEquals( 1, count( $listItems ) ); |
|
62 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
63 | + $this->assertEquals(1, count($listItems)); |
|
64 | 64 | |
65 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
66 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
67 | - $this->assertEquals( 'media', $listItem->getDomain() ); |
|
68 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
65 | + $this->assertEquals(1, $listItem->getStatus()); |
|
66 | + $this->assertEquals(0, $listItem->getPosition()); |
|
67 | + $this->assertEquals('media', $listItem->getDomain()); |
|
68 | + $this->assertEquals('default', $listItem->getType()); |
|
69 | 69 | |
70 | 70 | $refItem = $listItem->getRefItem(); |
71 | 71 | |
72 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
73 | - $this->assertEquals( 'default', $refItem->getType() ); |
|
74 | - $this->assertEquals( 'test image', $refItem->getLabel() ); |
|
75 | - $this->assertEquals( 'image/jpeg', $refItem->getMimetype() ); |
|
76 | - $this->assertEquals( 'path/to/preview', $refItem->getPreview() ); |
|
77 | - $this->assertEquals( 'path/to/file', $refItem->getUrl() ); |
|
78 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
72 | + $this->assertEquals(1, $refItem->getStatus()); |
|
73 | + $this->assertEquals('default', $refItem->getType()); |
|
74 | + $this->assertEquals('test image', $refItem->getLabel()); |
|
75 | + $this->assertEquals('image/jpeg', $refItem->getMimetype()); |
|
76 | + $this->assertEquals('path/to/preview', $refItem->getPreview()); |
|
77 | + $this->assertEquals('path/to/file', $refItem->getUrl()); |
|
78 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -89,21 +89,21 @@ discard block |
||
89 | 89 | 0 => "path/to/0\npath/to/1\npath/to/2\npath/to/3", |
90 | 90 | ); |
91 | 91 | |
92 | - $catalog = $this->create( 'job_csv_test' ); |
|
92 | + $catalog = $this->create('job_csv_test'); |
|
93 | 93 | |
94 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
95 | - $object->process( $catalog, $data ); |
|
94 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
95 | + $object->process($catalog, $data); |
|
96 | 96 | |
97 | 97 | |
98 | 98 | $pos = 0; |
99 | 99 | $listItems = $catalog->getListItems(); |
100 | - $expected = array( 'path/to/0', 'path/to/1', 'path/to/2', 'path/to/3' ); |
|
100 | + $expected = array('path/to/0', 'path/to/1', 'path/to/2', 'path/to/3'); |
|
101 | 101 | |
102 | - $this->assertEquals( 4, count( $listItems ) ); |
|
102 | + $this->assertEquals(4, count($listItems)); |
|
103 | 103 | |
104 | - foreach( $listItems as $listItem ) |
|
104 | + foreach ($listItems as $listItem) |
|
105 | 105 | { |
106 | - $this->assertEquals( $expected[$pos], $listItem->getRefItem()->getUrl() ); |
|
106 | + $this->assertEquals($expected[$pos], $listItem->getRefItem()->getUrl()); |
|
107 | 107 | $pos++; |
108 | 108 | } |
109 | 109 | } |
@@ -125,20 +125,20 @@ discard block |
||
125 | 125 | 3 => 'path/to/3', |
126 | 126 | ); |
127 | 127 | |
128 | - $catalog = $this->create( 'job_csv_test' ); |
|
128 | + $catalog = $this->create('job_csv_test'); |
|
129 | 129 | |
130 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
131 | - $object->process( $catalog, $data ); |
|
130 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
131 | + $object->process($catalog, $data); |
|
132 | 132 | |
133 | 133 | |
134 | 134 | $pos = 0; |
135 | 135 | $listItems = $catalog->getListItems(); |
136 | 136 | |
137 | - $this->assertEquals( 4, count( $listItems ) ); |
|
137 | + $this->assertEquals(4, count($listItems)); |
|
138 | 138 | |
139 | - foreach( $listItems as $listItem ) |
|
139 | + foreach ($listItems as $listItem) |
|
140 | 140 | { |
141 | - $this->assertEquals( $data[$pos], $listItem->getRefItem()->getUrl() ); |
|
141 | + $this->assertEquals($data[$pos], $listItem->getRefItem()->getUrl()); |
|
142 | 142 | $pos++; |
143 | 143 | } |
144 | 144 | } |
@@ -161,21 +161,21 @@ discard block |
||
161 | 161 | 1 => '', |
162 | 162 | ); |
163 | 163 | |
164 | - $catalog = $this->create( 'job_csv_test' ); |
|
164 | + $catalog = $this->create('job_csv_test'); |
|
165 | 165 | |
166 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
167 | - $object->process( $catalog, $data ); |
|
168 | - $object->process( $catalog, $dataUpdate ); |
|
166 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
167 | + $object->process($catalog, $data); |
|
168 | + $object->process($catalog, $dataUpdate); |
|
169 | 169 | |
170 | 170 | |
171 | 171 | $listItems = $catalog->getListItems(); |
172 | - $listItem = reset( $listItems ); |
|
172 | + $listItem = reset($listItems); |
|
173 | 173 | |
174 | - $this->assertEquals( 1, count( $listItems ) ); |
|
175 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
174 | + $this->assertEquals(1, count($listItems)); |
|
175 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
176 | 176 | |
177 | - $this->assertEquals( 'path/to/new', $listItem->getRefItem()->getUrl() ); |
|
178 | - $this->assertEquals( null, $listItem->getRefItem()->getLanguageId() ); |
|
177 | + $this->assertEquals('path/to/new', $listItem->getRefItem()->getUrl()); |
|
178 | + $this->assertEquals(null, $listItem->getRefItem()->getLanguageId()); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -189,18 +189,18 @@ discard block |
||
189 | 189 | 0 => '/path/to/file', |
190 | 190 | ); |
191 | 191 | |
192 | - $catalog = $this->create( 'job_csv_test' ); |
|
192 | + $catalog = $this->create('job_csv_test'); |
|
193 | 193 | |
194 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
195 | - $object->process( $catalog, $data ); |
|
194 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
195 | + $object->process($catalog, $data); |
|
196 | 196 | |
197 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, [], $this->endpoint ); |
|
198 | - $object->process( $catalog, [] ); |
|
197 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, [], $this->endpoint); |
|
198 | + $object->process($catalog, []); |
|
199 | 199 | |
200 | 200 | |
201 | 201 | $listItems = $catalog->getListItems(); |
202 | 202 | |
203 | - $this->assertEquals( 0, count( $listItems ) ); |
|
203 | + $this->assertEquals(0, count($listItems)); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -216,15 +216,15 @@ discard block |
||
216 | 216 | 1 => '', |
217 | 217 | ); |
218 | 218 | |
219 | - $catalog = $this->create( 'job_csv_test' ); |
|
219 | + $catalog = $this->create('job_csv_test'); |
|
220 | 220 | |
221 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
222 | - $object->process( $catalog, $data ); |
|
221 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
222 | + $object->process($catalog, $data); |
|
223 | 223 | |
224 | 224 | |
225 | 225 | $listItems = $catalog->getListItems(); |
226 | 226 | |
227 | - $this->assertEquals( 1, count( $listItems ) ); |
|
227 | + $this->assertEquals(1, count($listItems)); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | |
@@ -244,26 +244,26 @@ discard block |
||
244 | 244 | 3 => 'default', |
245 | 245 | ); |
246 | 246 | |
247 | - $this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/media/listtypes', array( 'default' ) ); |
|
247 | + $this->context->getConfig()->set('controller/common/catalog/import/csv/processor/media/listtypes', array('default')); |
|
248 | 248 | |
249 | - $catalog = $this->create( 'job_csv_test' ); |
|
249 | + $catalog = $this->create('job_csv_test'); |
|
250 | 250 | |
251 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
251 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
252 | 252 | |
253 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
254 | - $object->process( $catalog, $data ); |
|
253 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
254 | + $object->process($catalog, $data); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | |
258 | 258 | /** |
259 | 259 | * @param string $code |
260 | 260 | */ |
261 | - protected function create( $code ) |
|
261 | + protected function create($code) |
|
262 | 262 | { |
263 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context ); |
|
263 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context); |
|
264 | 264 | |
265 | 265 | $item = $manager->createItem(); |
266 | - $item->setCode( $code ); |
|
266 | + $item->setCode($code); |
|
267 | 267 | |
268 | 268 | return $item; |
269 | 269 | } |
@@ -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\Catalog\Import\Csv\Processor\Done( $this->context, [] ); |
|
23 | + $this->endpoint = new \Aimeos\Controller\Common\Catalog\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 | |
@@ -48,31 +48,31 @@ discard block |
||
48 | 48 | 4 => 1, |
49 | 49 | ); |
50 | 50 | |
51 | - $catalog = $this->create( 'job_csv_test' ); |
|
51 | + $catalog = $this->create('job_csv_test'); |
|
52 | 52 | |
53 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
54 | - $object->process( $catalog, $data ); |
|
53 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
54 | + $object->process($catalog, $data); |
|
55 | 55 | |
56 | 56 | |
57 | 57 | $listItems = $catalog->getListItems(); |
58 | - $listItem = reset( $listItems ); |
|
58 | + $listItem = reset($listItems); |
|
59 | 59 | |
60 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
61 | - $this->assertEquals( 1, count( $listItems ) ); |
|
60 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
61 | + $this->assertEquals(1, count($listItems)); |
|
62 | 62 | |
63 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
64 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
65 | - $this->assertEquals( 'text', $listItem->getDomain() ); |
|
66 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
63 | + $this->assertEquals(1, $listItem->getStatus()); |
|
64 | + $this->assertEquals(0, $listItem->getPosition()); |
|
65 | + $this->assertEquals('text', $listItem->getDomain()); |
|
66 | + $this->assertEquals('default', $listItem->getType()); |
|
67 | 67 | |
68 | 68 | $refItem = $listItem->getRefItem(); |
69 | 69 | |
70 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
71 | - $this->assertEquals( 'name', $refItem->getType() ); |
|
72 | - $this->assertEquals( 'test text', $refItem->getLabel() ); |
|
73 | - $this->assertEquals( 'Job CSV test', $refItem->getContent() ); |
|
74 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
75 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
70 | + $this->assertEquals(1, $refItem->getStatus()); |
|
71 | + $this->assertEquals('name', $refItem->getType()); |
|
72 | + $this->assertEquals('test text', $refItem->getLabel()); |
|
73 | + $this->assertEquals('Job CSV test', $refItem->getContent()); |
|
74 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
75 | + $this->assertEquals(1, $refItem->getStatus()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
@@ -100,27 +100,27 @@ discard block |
||
100 | 100 | 7 => 'Long: Job CSV test 2', |
101 | 101 | ); |
102 | 102 | |
103 | - $catalog = $this->create( 'job_csv_test' ); |
|
103 | + $catalog = $this->create('job_csv_test'); |
|
104 | 104 | |
105 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
106 | - $object->process( $catalog, $data ); |
|
105 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
106 | + $object->process($catalog, $data); |
|
107 | 107 | |
108 | 108 | |
109 | 109 | $pos = 0; |
110 | 110 | $listItems = $catalog->getListItems(); |
111 | 111 | $expected = array( |
112 | - 0 => array( 'name', 'Job CSV test' ), |
|
113 | - 1 => array( 'short', 'Short: Job CSV test' ), |
|
114 | - 2 => array( 'long', 'Long: Job CSV test' ), |
|
115 | - 3 => array( 'long', 'Long: Job CSV test 2' ), |
|
112 | + 0 => array('name', 'Job CSV test'), |
|
113 | + 1 => array('short', 'Short: Job CSV test'), |
|
114 | + 2 => array('long', 'Long: Job CSV test'), |
|
115 | + 3 => array('long', 'Long: Job CSV test 2'), |
|
116 | 116 | ); |
117 | 117 | |
118 | - $this->assertEquals( 4, count( $listItems ) ); |
|
118 | + $this->assertEquals(4, count($listItems)); |
|
119 | 119 | |
120 | - foreach( $listItems as $listItem ) |
|
120 | + foreach ($listItems as $listItem) |
|
121 | 121 | { |
122 | - $this->assertEquals( $expected[$pos][0], $listItem->getRefItem()->getType() ); |
|
123 | - $this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getContent() ); |
|
122 | + $this->assertEquals($expected[$pos][0], $listItem->getRefItem()->getType()); |
|
123 | + $this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getContent()); |
|
124 | 124 | $pos++; |
125 | 125 | } |
126 | 126 | } |
@@ -143,21 +143,21 @@ discard block |
||
143 | 143 | 1 => 'Short: Job CSV test', |
144 | 144 | ); |
145 | 145 | |
146 | - $catalog = $this->create( 'job_csv_test' ); |
|
146 | + $catalog = $this->create('job_csv_test'); |
|
147 | 147 | |
148 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
149 | - $object->process( $catalog, $data ); |
|
150 | - $object->process( $catalog, $dataUpdate ); |
|
148 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
149 | + $object->process($catalog, $data); |
|
150 | + $object->process($catalog, $dataUpdate); |
|
151 | 151 | |
152 | 152 | |
153 | 153 | $listItems = $catalog->getListItems(); |
154 | - $listItem = reset( $listItems ); |
|
154 | + $listItem = reset($listItems); |
|
155 | 155 | |
156 | - $this->assertEquals( 1, count( $listItems ) ); |
|
157 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
156 | + $this->assertEquals(1, count($listItems)); |
|
157 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
158 | 158 | |
159 | - $this->assertEquals( 'short', $listItem->getRefItem()->getType() ); |
|
160 | - $this->assertEquals( 'Short: Job CSV test', $listItem->getRefItem()->getContent() ); |
|
159 | + $this->assertEquals('short', $listItem->getRefItem()->getType()); |
|
160 | + $this->assertEquals('Short: Job CSV test', $listItem->getRefItem()->getContent()); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | |
@@ -173,18 +173,18 @@ discard block |
||
173 | 173 | 1 => 'Job CSV test', |
174 | 174 | ); |
175 | 175 | |
176 | - $catalog = $this->create( 'job_csv_test' ); |
|
176 | + $catalog = $this->create('job_csv_test'); |
|
177 | 177 | |
178 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
179 | - $object->process( $catalog, $data ); |
|
178 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
179 | + $object->process($catalog, $data); |
|
180 | 180 | |
181 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, [], $this->endpoint ); |
|
182 | - $object->process( $catalog, [] ); |
|
181 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, [], $this->endpoint); |
|
182 | + $object->process($catalog, []); |
|
183 | 183 | |
184 | 184 | |
185 | 185 | $listItems = $catalog->getListItems(); |
186 | 186 | |
187 | - $this->assertEquals( 0, count( $listItems ) ); |
|
187 | + $this->assertEquals(0, count($listItems)); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | |
@@ -204,15 +204,15 @@ discard block |
||
204 | 204 | 3 => '', |
205 | 205 | ); |
206 | 206 | |
207 | - $catalog = $this->create( 'job_csv_test' ); |
|
207 | + $catalog = $this->create('job_csv_test'); |
|
208 | 208 | |
209 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
210 | - $object->process( $catalog, $data ); |
|
209 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
210 | + $object->process($catalog, $data); |
|
211 | 211 | |
212 | 212 | |
213 | 213 | $listItems = $catalog->getListItems(); |
214 | 214 | |
215 | - $this->assertEquals( 1, count( $listItems ) ); |
|
215 | + $this->assertEquals(1, count($listItems)); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | |
@@ -236,26 +236,26 @@ discard block |
||
236 | 236 | 5 => 'default', |
237 | 237 | ); |
238 | 238 | |
239 | - $this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/text/listtypes', array( 'default' ) ); |
|
239 | + $this->context->getConfig()->set('controller/common/catalog/import/csv/processor/text/listtypes', array('default')); |
|
240 | 240 | |
241 | - $catalog = $this->create( 'job_csv_test' ); |
|
241 | + $catalog = $this->create('job_csv_test'); |
|
242 | 242 | |
243 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
243 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
244 | 244 | |
245 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
246 | - $object->process( $catalog, $data ); |
|
245 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
246 | + $object->process($catalog, $data); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | |
250 | 250 | /** |
251 | 251 | * @param string $code |
252 | 252 | */ |
253 | - protected function create( $code ) |
|
253 | + protected function create($code) |
|
254 | 254 | { |
255 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::create( $this->context ); |
|
255 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::create($this->context); |
|
256 | 256 | |
257 | 257 | $item = $manager->createItem(); |
258 | - $item->setCode( $code ); |
|
258 | + $item->setCode($code); |
|
259 | 259 | |
260 | 260 | return $item; |
261 | 261 | } |
@@ -16,61 +16,61 @@ 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 testGetCacheInvalidType() |
35 | 35 | { |
36 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
37 | - $this->object->getCachePublic( '$' ); |
|
36 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
37 | + $this->object->getCachePublic('$'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
41 | 41 | public function testGetCacheInvalidClass() |
42 | 42 | { |
43 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
44 | - $this->object->getCachePublic( 'unknown' ); |
|
43 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
44 | + $this->object->getCachePublic('unknown'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | public function testGetProcessors() |
49 | 49 | { |
50 | - $processor = $this->object->getProcessorsPublic( array( 'media' => [] ) ); |
|
50 | + $processor = $this->object->getProcessorsPublic(array('media' => [])); |
|
51 | 51 | |
52 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor ); |
|
52 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | 56 | public function testGetProcessorsInvalidType() |
57 | 57 | { |
58 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
59 | - $this->object->getProcessorsPublic( array( '$' => [] ) ); |
|
58 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
59 | + $this->object->getProcessorsPublic(array('$' => [])); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | public function testGetProcessorsInvalidClass() |
64 | 64 | { |
65 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
66 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
65 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
66 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | |
70 | 70 | public function testGetProcessorsInvalidInterface() |
71 | 71 | { |
72 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
73 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
72 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
73 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
@@ -78,15 +78,15 @@ discard block |
||
78 | 78 | class TestAbstract |
79 | 79 | extends \Aimeos\Controller\Common\Catalog\Import\Csv\Base |
80 | 80 | { |
81 | - public function getCachePublic( $type, $name = null ) |
|
81 | + public function getCachePublic($type, $name = null) |
|
82 | 82 | { |
83 | - return $this->getCache( $type, $name ); |
|
83 | + return $this->getCache($type, $name); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
87 | - public function getProcessorsPublic( array $mappings ) |
|
87 | + public function getProcessorsPublic(array $mappings) |
|
88 | 88 | { |
89 | - return $this->getProcessors( $mappings ); |
|
89 | + return $this->getProcessors($mappings); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 |
@@ -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 | |
@@ -50,31 +50,31 @@ discard block |
||
50 | 50 | 5 => 1, |
51 | 51 | ); |
52 | 52 | |
53 | - $product = $this->create( 'job_csv_test' ); |
|
53 | + $product = $this->create('job_csv_test'); |
|
54 | 54 | |
55 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
56 | - $object->process( $product, $data ); |
|
55 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
56 | + $object->process($product, $data); |
|
57 | 57 | |
58 | 58 | |
59 | 59 | $listItems = $product->getListItems(); |
60 | - $listItem = reset( $listItems ); |
|
60 | + $listItem = reset($listItems); |
|
61 | 61 | |
62 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
63 | - $this->assertEquals( 1, count( $listItems ) ); |
|
62 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
63 | + $this->assertEquals(1, count($listItems)); |
|
64 | 64 | |
65 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
66 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
67 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
65 | + $this->assertEquals(1, $listItem->getStatus()); |
|
66 | + $this->assertEquals(0, $listItem->getPosition()); |
|
67 | + $this->assertEquals('default', $listItem->getType()); |
|
68 | 68 | |
69 | 69 | $refItem = $listItem->getRefItem(); |
70 | 70 | |
71 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
72 | - $this->assertEquals( 'default', $refItem->getType() ); |
|
73 | - $this->assertEquals( 'test image', $refItem->getLabel() ); |
|
74 | - $this->assertEquals( 'image/jpeg', $refItem->getMimetype() ); |
|
75 | - $this->assertEquals( 'path/to/preview', $refItem->getPreview() ); |
|
76 | - $this->assertEquals( 'path/to/file', $refItem->getUrl() ); |
|
77 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
71 | + $this->assertEquals(1, $refItem->getStatus()); |
|
72 | + $this->assertEquals('default', $refItem->getType()); |
|
73 | + $this->assertEquals('test image', $refItem->getLabel()); |
|
74 | + $this->assertEquals('image/jpeg', $refItem->getMimetype()); |
|
75 | + $this->assertEquals('path/to/preview', $refItem->getPreview()); |
|
76 | + $this->assertEquals('path/to/file', $refItem->getUrl()); |
|
77 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | |
@@ -88,21 +88,21 @@ discard block |
||
88 | 88 | 0 => "path/to/0\npath/to/1\npath/to/2\npath/to/3", |
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\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
94 | - $object->process( $product, $data ); |
|
93 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\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 | - $expected = array( 'path/to/0', 'path/to/1', 'path/to/2', 'path/to/3' ); |
|
99 | + $expected = array('path/to/0', 'path/to/1', 'path/to/2', 'path/to/3'); |
|
100 | 100 | |
101 | - $this->assertEquals( 4, count( $listItems ) ); |
|
101 | + $this->assertEquals(4, count($listItems)); |
|
102 | 102 | |
103 | - foreach( $listItems as $listItem ) |
|
103 | + foreach ($listItems as $listItem) |
|
104 | 104 | { |
105 | - $this->assertEquals( $expected[$pos], $listItem->getRefItem()->getUrl() ); |
|
105 | + $this->assertEquals($expected[$pos], $listItem->getRefItem()->getUrl()); |
|
106 | 106 | $pos++; |
107 | 107 | } |
108 | 108 | } |
@@ -124,20 +124,20 @@ discard block |
||
124 | 124 | 3 => 'path/to/3', |
125 | 125 | ); |
126 | 126 | |
127 | - $product = $this->create( 'job_csv_test' ); |
|
127 | + $product = $this->create('job_csv_test'); |
|
128 | 128 | |
129 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
130 | - $object->process( $product, $data ); |
|
129 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
130 | + $object->process($product, $data); |
|
131 | 131 | |
132 | 132 | |
133 | 133 | $pos = 0; |
134 | 134 | $listItems = $product->getListItems(); |
135 | 135 | |
136 | - $this->assertEquals( 4, count( $listItems ) ); |
|
136 | + $this->assertEquals(4, count($listItems)); |
|
137 | 137 | |
138 | - foreach( $listItems as $listItem ) |
|
138 | + foreach ($listItems as $listItem) |
|
139 | 139 | { |
140 | - $this->assertEquals( $data[$pos], $listItem->getRefItem()->getUrl() ); |
|
140 | + $this->assertEquals($data[$pos], $listItem->getRefItem()->getUrl()); |
|
141 | 141 | $pos++; |
142 | 142 | } |
143 | 143 | } |
@@ -160,21 +160,21 @@ discard block |
||
160 | 160 | 1 => '', |
161 | 161 | ); |
162 | 162 | |
163 | - $product = $this->create( 'job_csv_test' ); |
|
163 | + $product = $this->create('job_csv_test'); |
|
164 | 164 | |
165 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
166 | - $object->process( $product, $data ); |
|
167 | - $object->process( $product, $dataUpdate ); |
|
165 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
166 | + $object->process($product, $data); |
|
167 | + $object->process($product, $dataUpdate); |
|
168 | 168 | |
169 | 169 | |
170 | 170 | $listItems = $product->getListItems(); |
171 | - $listItem = reset( $listItems ); |
|
171 | + $listItem = reset($listItems); |
|
172 | 172 | |
173 | - $this->assertEquals( 1, count( $listItems ) ); |
|
174 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
173 | + $this->assertEquals(1, count($listItems)); |
|
174 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
175 | 175 | |
176 | - $this->assertEquals( 'path/to/new', $listItem->getRefItem()->getUrl() ); |
|
177 | - $this->assertEquals( null, $listItem->getRefItem()->getLanguageId() ); |
|
176 | + $this->assertEquals('path/to/new', $listItem->getRefItem()->getUrl()); |
|
177 | + $this->assertEquals(null, $listItem->getRefItem()->getLanguageId()); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | |
@@ -188,18 +188,18 @@ discard block |
||
188 | 188 | 0 => '/path/to/file', |
189 | 189 | ); |
190 | 190 | |
191 | - $product = $this->create( 'job_csv_test' ); |
|
191 | + $product = $this->create('job_csv_test'); |
|
192 | 192 | |
193 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
194 | - $object->process( $product, $data ); |
|
193 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
194 | + $object->process($product, $data); |
|
195 | 195 | |
196 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, [], $this->endpoint ); |
|
197 | - $object->process( $product, [] ); |
|
196 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, [], $this->endpoint); |
|
197 | + $object->process($product, []); |
|
198 | 198 | |
199 | 199 | |
200 | 200 | $listItems = $product->getListItems(); |
201 | 201 | |
202 | - $this->assertEquals( 0, count( $listItems ) ); |
|
202 | + $this->assertEquals(0, count($listItems)); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | 1 => '', |
216 | 216 | ); |
217 | 217 | |
218 | - $product = $this->create( 'job_csv_test' ); |
|
218 | + $product = $this->create('job_csv_test'); |
|
219 | 219 | |
220 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
221 | - $object->process( $product, $data ); |
|
220 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
221 | + $object->process($product, $data); |
|
222 | 222 | |
223 | 223 | |
224 | 224 | $listItems = $product->getListItems(); |
225 | 225 | |
226 | - $this->assertEquals( 1, count( $listItems ) ); |
|
226 | + $this->assertEquals(1, count($listItems)); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | |
@@ -243,23 +243,23 @@ discard block |
||
243 | 243 | 3 => 'default', |
244 | 244 | ); |
245 | 245 | |
246 | - $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/media/listtypes', array( 'default' ) ); |
|
246 | + $this->context->getConfig()->set('controller/common/product/import/csv/processor/media/listtypes', array('default')); |
|
247 | 247 | |
248 | - $product = $this->create( 'job_csv_test' ); |
|
248 | + $product = $this->create('job_csv_test'); |
|
249 | 249 | |
250 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
250 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
251 | 251 | |
252 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
253 | - $object->process( $product, $data ); |
|
252 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
253 | + $object->process($product, $data); |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | |
257 | 257 | /** |
258 | 258 | * @param string $code |
259 | 259 | */ |
260 | - protected function create( $code ) |
|
260 | + protected function create($code) |
|
261 | 261 | { |
262 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context ); |
|
263 | - return $manager->createItem()->setCode( $code ); |
|
262 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context); |
|
263 | + return $manager->createItem()->setCode($code); |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | \ No newline at end of file |
@@ -17,26 +17,26 @@ |
||
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->object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] ); |
|
23 | + $this->object = 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 | $this->object = null; |
31 | 31 | } |
32 | 32 | |
33 | 33 | |
34 | 34 | public function testProcess() |
35 | 35 | { |
36 | - $product = \Aimeos\MShop::create( $this->context, 'product' )->createItem(); |
|
36 | + $product = \Aimeos\MShop::create($this->context, 'product')->createItem(); |
|
37 | 37 | |
38 | - $result = $this->object->process( $product, array( 'test' ) ); |
|
38 | + $result = $this->object->process($product, array('test')); |
|
39 | 39 | |
40 | - $this->assertEquals( array( 'test' ), $result ); |
|
40 | + $this->assertEquals(array('test'), $result); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -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 | |
@@ -56,29 +56,29 @@ discard block |
||
56 | 56 | 8 => 'variant', |
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\Attribute\Standard( $this->context, $mapping, $this->endpoint ); |
|
62 | - $object->process( $product, $data ); |
|
61 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint); |
|
62 | + $object->process($product, $data); |
|
63 | 63 | |
64 | 64 | |
65 | 65 | $pos = 0; |
66 | 66 | $listItems = $product->getListItems(); |
67 | 67 | $expected = array( |
68 | - array( 'variant', 'length', '30' ), |
|
69 | - array( 'variant', 'width', '29' ), |
|
70 | - array( 'variant', 'color', 'white' ), |
|
68 | + array('variant', 'length', '30'), |
|
69 | + array('variant', 'width', '29'), |
|
70 | + array('variant', 'color', 'white'), |
|
71 | 71 | ); |
72 | 72 | |
73 | - $this->assertEquals( 3, count( $listItems ) ); |
|
73 | + $this->assertEquals(3, count($listItems)); |
|
74 | 74 | |
75 | - foreach( $listItems as $listItem ) |
|
75 | + foreach ($listItems as $listItem) |
|
76 | 76 | { |
77 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
78 | - $this->assertEquals( 'attribute', $listItem->getDomain() ); |
|
79 | - $this->assertEquals( $expected[$pos][0], $listItem->getType() ); |
|
80 | - $this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getType() ); |
|
81 | - $this->assertEquals( $expected[$pos][2], $listItem->getRefItem()->getCode() ); |
|
77 | + $this->assertEquals(1, $listItem->getStatus()); |
|
78 | + $this->assertEquals('attribute', $listItem->getDomain()); |
|
79 | + $this->assertEquals($expected[$pos][0], $listItem->getType()); |
|
80 | + $this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getType()); |
|
81 | + $this->assertEquals($expected[$pos][2], $listItem->getRefItem()->getCode()); |
|
82 | 82 | $pos++; |
83 | 83 | } |
84 | 84 | } |
@@ -98,25 +98,25 @@ discard block |
||
98 | 98 | 2 => 'variant', |
99 | 99 | ); |
100 | 100 | |
101 | - $product = $this->create( 'job_csv_test' ); |
|
101 | + $product = $this->create('job_csv_test'); |
|
102 | 102 | |
103 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint ); |
|
104 | - $object->process( $product, $data ); |
|
103 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint); |
|
104 | + $object->process($product, $data); |
|
105 | 105 | |
106 | 106 | |
107 | 107 | $pos = 0; |
108 | - $codes = array( 'white', 'black', 'aimeos' ); |
|
108 | + $codes = array('white', 'black', 'aimeos'); |
|
109 | 109 | |
110 | - foreach( $product->getListItems() as $listItems ) |
|
110 | + foreach ($product->getListItems() as $listItems) |
|
111 | 111 | { |
112 | - $this->assertEquals( 3, count( $listItems ) ); |
|
112 | + $this->assertEquals(3, count($listItems)); |
|
113 | 113 | |
114 | - foreach( $listItems as $listItem ) |
|
114 | + foreach ($listItems as $listItem) |
|
115 | 115 | { |
116 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
117 | - $this->assertEquals( 'attribute', $listItem->getDomain() ); |
|
118 | - $this->assertEquals( 'variant', $listItem->getType() ); |
|
119 | - $this->assertEquals( $codes[$pos], $listItem->getRefItem()->getCode() ); |
|
116 | + $this->assertEquals(1, $listItem->getStatus()); |
|
117 | + $this->assertEquals('attribute', $listItem->getDomain()); |
|
118 | + $this->assertEquals('variant', $listItem->getType()); |
|
119 | + $this->assertEquals($codes[$pos], $listItem->getRefItem()->getCode()); |
|
120 | 120 | $pos++; |
121 | 121 | } |
122 | 122 | } |
@@ -140,21 +140,21 @@ discard block |
||
140 | 140 | 1 => '29', |
141 | 141 | ); |
142 | 142 | |
143 | - $product = $this->create( 'job_csv_test' ); |
|
143 | + $product = $this->create('job_csv_test'); |
|
144 | 144 | |
145 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint ); |
|
146 | - $object->process( $product, $data ); |
|
147 | - $object->process( $product, $dataUpdate ); |
|
145 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint); |
|
146 | + $object->process($product, $data); |
|
147 | + $object->process($product, $dataUpdate); |
|
148 | 148 | |
149 | 149 | |
150 | 150 | $listItems = $product->getListItems(); |
151 | - $listItem = reset( $listItems ); |
|
151 | + $listItem = reset($listItems); |
|
152 | 152 | |
153 | - $this->assertEquals( 1, count( $listItems ) ); |
|
154 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
153 | + $this->assertEquals(1, count($listItems)); |
|
154 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
155 | 155 | |
156 | - $this->assertEquals( 'width', $listItem->getRefItem()->getType() ); |
|
157 | - $this->assertEquals( '29', $listItem->getRefItem()->getCode() ); |
|
156 | + $this->assertEquals('width', $listItem->getRefItem()->getType()); |
|
157 | + $this->assertEquals('29', $listItem->getRefItem()->getCode()); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -170,18 +170,18 @@ discard block |
||
170 | 170 | 1 => '30', |
171 | 171 | ); |
172 | 172 | |
173 | - $product = $this->create( 'job_csv_test' ); |
|
173 | + $product = $this->create('job_csv_test'); |
|
174 | 174 | |
175 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint ); |
|
176 | - $object->process( $product, $data ); |
|
175 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint); |
|
176 | + $object->process($product, $data); |
|
177 | 177 | |
178 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, [], $this->endpoint ); |
|
179 | - $object->process( $product, [] ); |
|
178 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, [], $this->endpoint); |
|
179 | + $object->process($product, []); |
|
180 | 180 | |
181 | 181 | |
182 | 182 | $listItems = $product->getListItems(); |
183 | 183 | |
184 | - $this->assertEquals( 0, count( $listItems ) ); |
|
184 | + $this->assertEquals(0, count($listItems)); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | |
@@ -201,15 +201,15 @@ discard block |
||
201 | 201 | 3 => '30', |
202 | 202 | ); |
203 | 203 | |
204 | - $product = $this->create( 'job_csv_test' ); |
|
204 | + $product = $this->create('job_csv_test'); |
|
205 | 205 | |
206 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint ); |
|
207 | - $object->process( $product, $data ); |
|
206 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint); |
|
207 | + $object->process($product, $data); |
|
208 | 208 | |
209 | 209 | |
210 | 210 | $listItems = $product->getListItems(); |
211 | 211 | |
212 | - $this->assertEquals( 1, count( $listItems ) ); |
|
212 | + $this->assertEquals(1, count($listItems)); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
@@ -233,23 +233,23 @@ discard block |
||
233 | 233 | 5 => 'default', |
234 | 234 | ); |
235 | 235 | |
236 | - $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/attribute/listtypes', array( 'default' ) ); |
|
236 | + $this->context->getConfig()->set('controller/common/product/import/csv/processor/attribute/listtypes', array('default')); |
|
237 | 237 | |
238 | - $product = $this->create( 'job_csv_test' ); |
|
238 | + $product = $this->create('job_csv_test'); |
|
239 | 239 | |
240 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint ); |
|
240 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint); |
|
241 | 241 | |
242 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
243 | - $object->process( $product, $data ); |
|
242 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
243 | + $object->process($product, $data); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | |
247 | 247 | /** |
248 | 248 | * @param string $code |
249 | 249 | */ |
250 | - protected function create( $code ) |
|
250 | + protected function create($code) |
|
251 | 251 | { |
252 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context ); |
|
253 | - return $manager->createItem()->setCode( $code ); |
|
252 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context); |
|
253 | + return $manager->createItem()->setCode($code); |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | \ No newline at end of file |
@@ -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 | |
@@ -56,33 +56,33 @@ discard block |
||
56 | 56 | 8 => 1, |
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\Price\Standard( $this->context, $mapping, $this->endpoint ); |
|
62 | - $object->process( $product, $data ); |
|
61 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint); |
|
62 | + $object->process($product, $data); |
|
63 | 63 | |
64 | 64 | |
65 | 65 | $listItems = $product->getListItems(); |
66 | - $listItem = reset( $listItems ); |
|
66 | + $listItem = reset($listItems); |
|
67 | 67 | |
68 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
69 | - $this->assertEquals( 1, count( $listItems ) ); |
|
68 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
69 | + $this->assertEquals(1, count($listItems)); |
|
70 | 70 | |
71 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
72 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
73 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
71 | + $this->assertEquals(1, $listItem->getStatus()); |
|
72 | + $this->assertEquals(0, $listItem->getPosition()); |
|
73 | + $this->assertEquals('default', $listItem->getType()); |
|
74 | 74 | |
75 | 75 | $refItem = $listItem->getRefItem(); |
76 | 76 | |
77 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
78 | - $this->assertEquals( 'default', $refItem->getType() ); |
|
79 | - $this->assertEquals( 'EUR 1.00', $refItem->getLabel() ); |
|
80 | - $this->assertEquals( 5, $refItem->getQuantity() ); |
|
81 | - $this->assertEquals( '1.00', $refItem->getValue() ); |
|
82 | - $this->assertEquals( '0.20', $refItem->getCosts() ); |
|
83 | - $this->assertEquals( '0.10', $refItem->getRebate() ); |
|
84 | - $this->assertEquals( '20.00', $refItem->getTaxrate() ); |
|
85 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
77 | + $this->assertEquals(1, $refItem->getStatus()); |
|
78 | + $this->assertEquals('default', $refItem->getType()); |
|
79 | + $this->assertEquals('EUR 1.00', $refItem->getLabel()); |
|
80 | + $this->assertEquals(5, $refItem->getQuantity()); |
|
81 | + $this->assertEquals('1.00', $refItem->getValue()); |
|
82 | + $this->assertEquals('0.20', $refItem->getCosts()); |
|
83 | + $this->assertEquals('0.10', $refItem->getRebate()); |
|
84 | + $this->assertEquals('20.00', $refItem->getTaxrate()); |
|
85 | + $this->assertEquals(1, $refItem->getStatus()); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
@@ -110,21 +110,21 @@ discard block |
||
110 | 110 | 7 => '4.00', |
111 | 111 | ); |
112 | 112 | |
113 | - $product = $this->create( 'job_csv_test' ); |
|
113 | + $product = $this->create('job_csv_test'); |
|
114 | 114 | |
115 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint ); |
|
116 | - $object->process( $product, $data ); |
|
115 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint); |
|
116 | + $object->process($product, $data); |
|
117 | 117 | |
118 | 118 | |
119 | 119 | $pos = 0; |
120 | 120 | $listItems = $product->getListItems(); |
121 | 121 | |
122 | - $this->assertEquals( 4, count( $listItems ) ); |
|
122 | + $this->assertEquals(4, count($listItems)); |
|
123 | 123 | |
124 | - foreach( $listItems as $listItem ) |
|
124 | + foreach ($listItems as $listItem) |
|
125 | 125 | { |
126 | - $this->assertEquals( $data[$pos++], $listItem->getRefItem()->getCurrencyId() ); |
|
127 | - $this->assertEquals( $data[$pos++], $listItem->getRefItem()->getValue() ); |
|
126 | + $this->assertEquals($data[$pos++], $listItem->getRefItem()->getCurrencyId()); |
|
127 | + $this->assertEquals($data[$pos++], $listItem->getRefItem()->getValue()); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
@@ -146,20 +146,20 @@ discard block |
||
146 | 146 | 1 => '2.00', |
147 | 147 | ); |
148 | 148 | |
149 | - $product = $this->create( 'job_csv_test' ); |
|
149 | + $product = $this->create('job_csv_test'); |
|
150 | 150 | |
151 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint ); |
|
152 | - $object->process( $product, $data ); |
|
153 | - $object->process( $product, $dataUpdate ); |
|
151 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint); |
|
152 | + $object->process($product, $data); |
|
153 | + $object->process($product, $dataUpdate); |
|
154 | 154 | |
155 | 155 | |
156 | 156 | $listItems = $product->getListItems(); |
157 | - $listItem = reset( $listItems ); |
|
157 | + $listItem = reset($listItems); |
|
158 | 158 | |
159 | - $this->assertEquals( 1, count( $listItems ) ); |
|
160 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
159 | + $this->assertEquals(1, count($listItems)); |
|
160 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
161 | 161 | |
162 | - $this->assertEquals( '2.00', $listItem->getRefItem()->getValue() ); |
|
162 | + $this->assertEquals('2.00', $listItem->getRefItem()->getValue()); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | |
@@ -175,18 +175,18 @@ discard block |
||
175 | 175 | 1 => '1.00', |
176 | 176 | ); |
177 | 177 | |
178 | - $product = $this->create( 'job_csv_test' ); |
|
178 | + $product = $this->create('job_csv_test'); |
|
179 | 179 | |
180 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint ); |
|
181 | - $object->process( $product, $data ); |
|
180 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint); |
|
181 | + $object->process($product, $data); |
|
182 | 182 | |
183 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, [], $this->endpoint ); |
|
184 | - $object->process( $product, [] ); |
|
183 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, [], $this->endpoint); |
|
184 | + $object->process($product, []); |
|
185 | 185 | |
186 | 186 | |
187 | 187 | $listItems = $product->getListItems(); |
188 | 188 | |
189 | - $this->assertEquals( 0, count( $listItems ) ); |
|
189 | + $this->assertEquals(0, count($listItems)); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | |
@@ -206,15 +206,15 @@ discard block |
||
206 | 206 | 3 => '', |
207 | 207 | ); |
208 | 208 | |
209 | - $product = $this->create( 'job_csv_test' ); |
|
209 | + $product = $this->create('job_csv_test'); |
|
210 | 210 | |
211 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint ); |
|
212 | - $object->process( $product, $data ); |
|
211 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint); |
|
212 | + $object->process($product, $data); |
|
213 | 213 | |
214 | 214 | |
215 | 215 | $listItems = $product->getListItems(); |
216 | 216 | |
217 | - $this->assertEquals( 1, count( $listItems ) ); |
|
217 | + $this->assertEquals(1, count($listItems)); |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | |
@@ -238,23 +238,23 @@ discard block |
||
238 | 238 | 5 => 'default', |
239 | 239 | ); |
240 | 240 | |
241 | - $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/price/listtypes', array( 'default' ) ); |
|
241 | + $this->context->getConfig()->set('controller/common/product/import/csv/processor/price/listtypes', array('default')); |
|
242 | 242 | |
243 | - $product = $this->create( 'job_csv_test' ); |
|
243 | + $product = $this->create('job_csv_test'); |
|
244 | 244 | |
245 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint ); |
|
245 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint); |
|
246 | 246 | |
247 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
248 | - $object->process( $product, $data ); |
|
247 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
248 | + $object->process($product, $data); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | |
252 | 252 | /** |
253 | 253 | * @param string $code |
254 | 254 | */ |
255 | - protected function create( $code ) |
|
255 | + protected function create($code) |
|
256 | 256 | { |
257 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context ); |
|
258 | - return $manager->createItem()->setCode( $code ); |
|
257 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context); |
|
258 | + return $manager->createItem()->setCode($code); |
|
259 | 259 | } |
260 | 260 | } |
261 | 261 | \ No newline at end of file |
@@ -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 | |
@@ -48,26 +48,26 @@ discard block |
||
48 | 48 | 4 => '50', |
49 | 49 | ); |
50 | 50 | |
51 | - $product = $this->create( 'job_csv_test' ); |
|
51 | + $product = $this->create('job_csv_test'); |
|
52 | 52 | |
53 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint ); |
|
54 | - $object->process( $product, $data ); |
|
53 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint); |
|
54 | + $object->process($product, $data); |
|
55 | 55 | |
56 | 56 | |
57 | 57 | $pos = 0; |
58 | 58 | $expected = array( |
59 | - array( 'package-weight', '3.00', 'de' ), |
|
60 | - array( 'package-width', '50', null ), |
|
59 | + array('package-weight', '3.00', 'de'), |
|
60 | + array('package-width', '50', null), |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | $items = $product->getPropertyItems(); |
64 | - $this->assertEquals( 2, count( $items ) ); |
|
64 | + $this->assertEquals(2, count($items)); |
|
65 | 65 | |
66 | - foreach( $items as $item ) |
|
66 | + foreach ($items as $item) |
|
67 | 67 | { |
68 | - $this->assertEquals( $expected[$pos][0], $item->getType() ); |
|
69 | - $this->assertEquals( $expected[$pos][1], $item->getValue() ); |
|
70 | - $this->assertEquals( $expected[$pos][2], $item->getLanguageId() ); |
|
68 | + $this->assertEquals($expected[$pos][0], $item->getType()); |
|
69 | + $this->assertEquals($expected[$pos][1], $item->getValue()); |
|
70 | + $this->assertEquals($expected[$pos][2], $item->getLanguageId()); |
|
71 | 71 | $pos++; |
72 | 72 | } |
73 | 73 | } |
@@ -90,21 +90,21 @@ discard block |
||
90 | 90 | 1 => '10', |
91 | 91 | ); |
92 | 92 | |
93 | - $product = $this->create( 'job_csv_test' ); |
|
93 | + $product = $this->create('job_csv_test'); |
|
94 | 94 | |
95 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint ); |
|
96 | - $object->process( $product, $data ); |
|
97 | - $object->process( $product, $dataUpdate ); |
|
95 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint); |
|
96 | + $object->process($product, $data); |
|
97 | + $object->process($product, $dataUpdate); |
|
98 | 98 | |
99 | 99 | |
100 | 100 | $items = $product->getPropertyItems(); |
101 | - $item = reset( $items ); |
|
101 | + $item = reset($items); |
|
102 | 102 | |
103 | - $this->assertEquals( 1, count( $items ) ); |
|
104 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item ); |
|
103 | + $this->assertEquals(1, count($items)); |
|
104 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item); |
|
105 | 105 | |
106 | - $this->assertEquals( 'package-height', $item->getType() ); |
|
107 | - $this->assertEquals( '10', $item->getValue() ); |
|
106 | + $this->assertEquals('package-height', $item->getType()); |
|
107 | + $this->assertEquals('10', $item->getValue()); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -120,18 +120,18 @@ discard block |
||
120 | 120 | 1 => '3.00', |
121 | 121 | ); |
122 | 122 | |
123 | - $product = $this->create( 'job_csv_test' ); |
|
123 | + $product = $this->create('job_csv_test'); |
|
124 | 124 | |
125 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint ); |
|
126 | - $object->process( $product, $data ); |
|
125 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint); |
|
126 | + $object->process($product, $data); |
|
127 | 127 | |
128 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, [], $this->endpoint ); |
|
129 | - $object->process( $product, [] ); |
|
128 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, [], $this->endpoint); |
|
129 | + $object->process($product, []); |
|
130 | 130 | |
131 | 131 | |
132 | 132 | $items = $product->getPropertyItems(); |
133 | 133 | |
134 | - $this->assertEquals( 0, count( $items ) ); |
|
134 | + $this->assertEquals(0, count($items)); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | |
@@ -151,23 +151,23 @@ discard block |
||
151 | 151 | 3 => '3.00', |
152 | 152 | ); |
153 | 153 | |
154 | - $product = $this->create( 'job_csv_test' ); |
|
154 | + $product = $this->create('job_csv_test'); |
|
155 | 155 | |
156 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint ); |
|
157 | - $object->process( $product, $data ); |
|
156 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint); |
|
157 | + $object->process($product, $data); |
|
158 | 158 | |
159 | 159 | $items = $product->getPropertyItems(); |
160 | 160 | |
161 | - $this->assertEquals( 1, count( $items ) ); |
|
161 | + $this->assertEquals(1, count($items)); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
165 | 165 | /** |
166 | 166 | * @param string $code |
167 | 167 | */ |
168 | - protected function create( $code ) |
|
168 | + protected function create($code) |
|
169 | 169 | { |
170 | - $manager = \Aimeos\MShop\Product\Manager\Factory::create( $this->context ); |
|
171 | - return $manager->createItem()->setCode( $code ); |
|
170 | + $manager = \Aimeos\MShop\Product\Manager\Factory::create($this->context); |
|
171 | + return $manager->createItem()->setCode($code); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | \ No newline at end of file |