Completed
Push — master ( b85694...d1869e )
by Aimeos
02:13
created
tests/Controller/Common/Catalog/Import/Csv/Processor/Text/StandardTest.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(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\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -49,31 +49,31 @@  discard block
 block discarded – undo
49 49
 			4 => 1,
50 50
 		);
51 51
 
52
-		$catalog = $this->create( 'job_csv_test' );
52
+		$catalog = $this->create('job_csv_test');
53 53
 
54
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
55
-		$object->process( $catalog, $data );
54
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
55
+		$object->process($catalog, $data);
56 56
 
57 57
 
58 58
 		$listItems = $catalog->getListItems();
59
-		$listItem = reset( $listItems );
59
+		$listItem = reset($listItems);
60 60
 
61
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
62
-		$this->assertEquals( 1, count( $listItems ) );
61
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
62
+		$this->assertEquals(1, count($listItems));
63 63
 
64
-		$this->assertEquals( 1, $listItem->getStatus() );
65
-		$this->assertEquals( 0, $listItem->getPosition() );
66
-		$this->assertEquals( 'text', $listItem->getDomain() );
67
-		$this->assertEquals( 'default', $listItem->getType() );
64
+		$this->assertEquals(1, $listItem->getStatus());
65
+		$this->assertEquals(0, $listItem->getPosition());
66
+		$this->assertEquals('text', $listItem->getDomain());
67
+		$this->assertEquals('default', $listItem->getType());
68 68
 
69 69
 		$refItem = $listItem->getRefItem();
70 70
 
71
-		$this->assertEquals( 1, $refItem->getStatus() );
72
-		$this->assertEquals( 'name', $refItem->getType() );
73
-		$this->assertEquals( 'test text', $refItem->getLabel() );
74
-		$this->assertEquals( 'Job CSV test', $refItem->getContent() );
75
-		$this->assertEquals( 'de', $refItem->getLanguageId() );
76
-		$this->assertEquals( 1, $refItem->getStatus() );
71
+		$this->assertEquals(1, $refItem->getStatus());
72
+		$this->assertEquals('name', $refItem->getType());
73
+		$this->assertEquals('test text', $refItem->getLabel());
74
+		$this->assertEquals('Job CSV test', $refItem->getContent());
75
+		$this->assertEquals('de', $refItem->getLanguageId());
76
+		$this->assertEquals(1, $refItem->getStatus());
77 77
 	}
78 78
 
79 79
 
@@ -101,27 +101,27 @@  discard block
 block discarded – undo
101 101
 			7 => 'Long: Job CSV test 2',
102 102
 		);
103 103
 
104
-		$catalog = $this->create( 'job_csv_test' );
104
+		$catalog = $this->create('job_csv_test');
105 105
 
106
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
107
-		$object->process( $catalog, $data );
106
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
107
+		$object->process($catalog, $data);
108 108
 
109 109
 
110 110
 		$pos = 0;
111 111
 		$listItems = $catalog->getListItems();
112 112
 		$expected = array(
113
-			0 => array( 'name', 'Job CSV test' ),
114
-			1 => array( 'short', 'Short: Job CSV test' ),
115
-			2 => array( 'long', 'Long: Job CSV test' ),
116
-			3 => array( 'long', 'Long: Job CSV test 2' ),
113
+			0 => array('name', 'Job CSV test'),
114
+			1 => array('short', 'Short: Job CSV test'),
115
+			2 => array('long', 'Long: Job CSV test'),
116
+			3 => array('long', 'Long: Job CSV test 2'),
117 117
 		);
118 118
 
119
-		$this->assertEquals( 4, count( $listItems ) );
119
+		$this->assertEquals(4, count($listItems));
120 120
 
121
-		foreach( $listItems as $listItem )
121
+		foreach ($listItems as $listItem)
122 122
 		{
123
-			$this->assertEquals( $expected[$pos][0], $listItem->getRefItem()->getType() );
124
-			$this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getContent() );
123
+			$this->assertEquals($expected[$pos][0], $listItem->getRefItem()->getType());
124
+			$this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getContent());
125 125
 			$pos++;
126 126
 		}
127 127
 	}
@@ -144,21 +144,21 @@  discard block
 block discarded – undo
144 144
 			1 => 'Short: Job CSV test',
145 145
 		);
146 146
 
147
-		$catalog = $this->create( 'job_csv_test' );
147
+		$catalog = $this->create('job_csv_test');
148 148
 
149
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
150
-		$object->process( $catalog, $data );
151
-		$object->process( $catalog, $dataUpdate );
149
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
150
+		$object->process($catalog, $data);
151
+		$object->process($catalog, $dataUpdate);
152 152
 
153 153
 
154 154
 		$listItems = $catalog->getListItems();
155
-		$listItem = reset( $listItems );
155
+		$listItem = reset($listItems);
156 156
 
157
-		$this->assertEquals( 1, count( $listItems ) );
158
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
157
+		$this->assertEquals(1, count($listItems));
158
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
159 159
 
160
-		$this->assertEquals( 'short', $listItem->getRefItem()->getType() );
161
-		$this->assertEquals( 'Short: Job CSV test', $listItem->getRefItem()->getContent() );
160
+		$this->assertEquals('short', $listItem->getRefItem()->getType());
161
+		$this->assertEquals('Short: Job CSV test', $listItem->getRefItem()->getContent());
162 162
 	}
163 163
 
164 164
 
@@ -174,18 +174,18 @@  discard block
 block discarded – undo
174 174
 			1 => 'Job CSV test',
175 175
 		);
176 176
 
177
-		$catalog = $this->create( 'job_csv_test' );
177
+		$catalog = $this->create('job_csv_test');
178 178
 
179
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
180
-		$object->process( $catalog, $data );
179
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
180
+		$object->process($catalog, $data);
181 181
 
182
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, [], $this->endpoint );
183
-		$object->process( $catalog, [] );
182
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, [], $this->endpoint);
183
+		$object->process($catalog, []);
184 184
 
185 185
 
186 186
 		$listItems = $catalog->getListItems();
187 187
 
188
-		$this->assertEquals( 0, count( $listItems ) );
188
+		$this->assertEquals(0, count($listItems));
189 189
 	}
190 190
 
191 191
 
@@ -205,15 +205,15 @@  discard block
 block discarded – undo
205 205
 			3 => '',
206 206
 		);
207 207
 
208
-		$catalog = $this->create( 'job_csv_test' );
208
+		$catalog = $this->create('job_csv_test');
209 209
 
210
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
211
-		$object->process( $catalog, $data );
210
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
211
+		$object->process($catalog, $data);
212 212
 
213 213
 
214 214
 		$listItems = $catalog->getListItems();
215 215
 
216
-		$this->assertEquals( 1, count( $listItems ) );
216
+		$this->assertEquals(1, count($listItems));
217 217
 	}
218 218
 
219 219
 
@@ -237,35 +237,35 @@  discard block
 block discarded – undo
237 237
 			5 => 'default',
238 238
 		);
239 239
 
240
-		$this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/text/listtypes', array( 'default' ) );
240
+		$this->context->getConfig()->set('controller/common/catalog/import/csv/processor/text/listtypes', array('default'));
241 241
 
242
-		$catalog = $this->create( 'job_csv_test' );
242
+		$catalog = $this->create('job_csv_test');
243 243
 
244
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
245
-		$object->process( $catalog, $data );
244
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
245
+		$object->process($catalog, $data);
246 246
 
247 247
 
248 248
 		$listItems = $catalog->getListItems();
249
-		$listItem = reset( $listItems );
249
+		$listItem = reset($listItems);
250 250
 
251
-		$this->assertEquals( 1, count( $listItems ) );
252
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
251
+		$this->assertEquals(1, count($listItems));
252
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
253 253
 
254
-		$this->assertEquals( 'default', $listItem->getType() );
255
-		$this->assertEquals( 'short', $listItem->getRefItem()->getType() );
256
-		$this->assertEquals( 'test short', $listItem->getRefItem()->getContent() );
254
+		$this->assertEquals('default', $listItem->getType());
255
+		$this->assertEquals('short', $listItem->getRefItem()->getType());
256
+		$this->assertEquals('test short', $listItem->getRefItem()->getContent());
257 257
 	}
258 258
 
259 259
 
260 260
 	/**
261 261
 	 * @param string $code
262 262
 	 */
263
-	protected function create( $code )
263
+	protected function create($code)
264 264
 	{
265
-		$manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context );
265
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context);
266 266
 
267 267
 		$item = $manager->createItem();
268
-		$item->setCode( $code );
268
+		$item->setCode($code);
269 269
 
270 270
 		return $item;
271 271
 	}
Please login to merge, or discard this patch.
tests/Controller/Common/Catalog/Import/Csv/Processor/Media/StandardTest.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(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\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -51,32 +51,32 @@  discard block
 block discarded – undo
51 51
 			5 => 1,
52 52
 		);
53 53
 
54
-		$catalog = $this->create( 'job_csv_test' );
54
+		$catalog = $this->create('job_csv_test');
55 55
 
56
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
57
-		$object->process( $catalog, $data );
56
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
57
+		$object->process($catalog, $data);
58 58
 
59 59
 
60 60
 		$listItems = $catalog->getListItems();
61
-		$listItem = reset( $listItems );
61
+		$listItem = reset($listItems);
62 62
 
63
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
64
-		$this->assertEquals( 1, count( $listItems ) );
63
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
64
+		$this->assertEquals(1, count($listItems));
65 65
 
66
-		$this->assertEquals( 1, $listItem->getStatus() );
67
-		$this->assertEquals( 0, $listItem->getPosition() );
68
-		$this->assertEquals( 'media', $listItem->getDomain() );
69
-		$this->assertEquals( 'default', $listItem->getType() );
66
+		$this->assertEquals(1, $listItem->getStatus());
67
+		$this->assertEquals(0, $listItem->getPosition());
68
+		$this->assertEquals('media', $listItem->getDomain());
69
+		$this->assertEquals('default', $listItem->getType());
70 70
 
71 71
 		$refItem = $listItem->getRefItem();
72 72
 
73
-		$this->assertEquals( 1, $refItem->getStatus() );
74
-		$this->assertEquals( 'default', $refItem->getType() );
75
-		$this->assertEquals( 'test image', $refItem->getLabel() );
76
-		$this->assertEquals( 'image/jpeg', $refItem->getMimetype() );
77
-		$this->assertEquals( 'path/to/preview', $refItem->getPreview() );
78
-		$this->assertEquals( 'path/to/file', $refItem->getUrl() );
79
-		$this->assertEquals( 'de', $refItem->getLanguageId() );
73
+		$this->assertEquals(1, $refItem->getStatus());
74
+		$this->assertEquals('default', $refItem->getType());
75
+		$this->assertEquals('test image', $refItem->getLabel());
76
+		$this->assertEquals('image/jpeg', $refItem->getMimetype());
77
+		$this->assertEquals('path/to/preview', $refItem->getPreview());
78
+		$this->assertEquals('path/to/file', $refItem->getUrl());
79
+		$this->assertEquals('de', $refItem->getLanguageId());
80 80
 	}
81 81
 
82 82
 
@@ -90,21 +90,21 @@  discard block
 block discarded – undo
90 90
 			0 => "path/to/0\npath/to/1\npath/to/2\npath/to/3",
91 91
 		);
92 92
 
93
-		$catalog = $this->create( 'job_csv_test' );
93
+		$catalog = $this->create('job_csv_test');
94 94
 
95
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
96
-		$object->process( $catalog, $data );
95
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
96
+		$object->process($catalog, $data);
97 97
 
98 98
 
99 99
 		$pos = 0;
100 100
 		$listItems = $catalog->getListItems();
101
-		$expected = array( 'path/to/0', 'path/to/1', 'path/to/2', 'path/to/3' );
101
+		$expected = array('path/to/0', 'path/to/1', 'path/to/2', 'path/to/3');
102 102
 
103
-		$this->assertEquals( 4, count( $listItems ) );
103
+		$this->assertEquals(4, count($listItems));
104 104
 
105
-		foreach( $listItems as $listItem )
105
+		foreach ($listItems as $listItem)
106 106
 		{
107
-			$this->assertEquals( $expected[$pos], $listItem->getRefItem()->getUrl() );
107
+			$this->assertEquals($expected[$pos], $listItem->getRefItem()->getUrl());
108 108
 			$pos++;
109 109
 		}
110 110
 	}
@@ -126,20 +126,20 @@  discard block
 block discarded – undo
126 126
 			3 => 'path/to/3',
127 127
 		);
128 128
 
129
-		$catalog = $this->create( 'job_csv_test' );
129
+		$catalog = $this->create('job_csv_test');
130 130
 
131
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
132
-		$object->process( $catalog, $data );
131
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
132
+		$object->process($catalog, $data);
133 133
 
134 134
 
135 135
 		$pos = 0;
136 136
 		$listItems = $catalog->getListItems();
137 137
 
138
-		$this->assertEquals( 4, count( $listItems ) );
138
+		$this->assertEquals(4, count($listItems));
139 139
 
140
-		foreach( $listItems as $listItem )
140
+		foreach ($listItems as $listItem)
141 141
 		{
142
-			$this->assertEquals( $data[$pos], $listItem->getRefItem()->getUrl() );
142
+			$this->assertEquals($data[$pos], $listItem->getRefItem()->getUrl());
143 143
 			$pos++;
144 144
 		}
145 145
 	}
@@ -162,21 +162,21 @@  discard block
 block discarded – undo
162 162
 			1 => '',
163 163
 		);
164 164
 
165
-		$catalog = $this->create( 'job_csv_test' );
165
+		$catalog = $this->create('job_csv_test');
166 166
 
167
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
168
-		$object->process( $catalog, $data );
169
-		$object->process( $catalog, $dataUpdate );
167
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
168
+		$object->process($catalog, $data);
169
+		$object->process($catalog, $dataUpdate);
170 170
 
171 171
 
172 172
 		$listItems = $catalog->getListItems();
173
-		$listItem = reset( $listItems );
173
+		$listItem = reset($listItems);
174 174
 
175
-		$this->assertEquals( 1, count( $listItems ) );
176
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
175
+		$this->assertEquals(1, count($listItems));
176
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
177 177
 
178
-		$this->assertEquals( 'path/to/new', $listItem->getRefItem()->getUrl() );
179
-		$this->assertEquals( null, $listItem->getRefItem()->getLanguageId() );
178
+		$this->assertEquals('path/to/new', $listItem->getRefItem()->getUrl());
179
+		$this->assertEquals(null, $listItem->getRefItem()->getLanguageId());
180 180
 	}
181 181
 
182 182
 
@@ -190,18 +190,18 @@  discard block
 block discarded – undo
190 190
 			0 => '/path/to/file',
191 191
 		);
192 192
 
193
-		$catalog = $this->create( 'job_csv_test' );
193
+		$catalog = $this->create('job_csv_test');
194 194
 
195
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
196
-		$object->process( $catalog, $data );
195
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
196
+		$object->process($catalog, $data);
197 197
 
198
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, [], $this->endpoint );
199
-		$object->process( $catalog, [] );
198
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, [], $this->endpoint);
199
+		$object->process($catalog, []);
200 200
 
201 201
 
202 202
 		$listItems = $catalog->getListItems();
203 203
 
204
-		$this->assertEquals( 0, count( $listItems ) );
204
+		$this->assertEquals(0, count($listItems));
205 205
 	}
206 206
 
207 207
 
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 			1 => '',
218 218
 		);
219 219
 
220
-		$catalog = $this->create( 'job_csv_test' );
220
+		$catalog = $this->create('job_csv_test');
221 221
 
222
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
223
-		$object->process( $catalog, $data );
222
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
223
+		$object->process($catalog, $data);
224 224
 
225 225
 
226 226
 		$listItems = $catalog->getListItems();
227 227
 
228
-		$this->assertEquals( 1, count( $listItems ) );
228
+		$this->assertEquals(1, count($listItems));
229 229
 	}
230 230
 
231 231
 
@@ -245,34 +245,34 @@  discard block
 block discarded – undo
245 245
 			3 => 'default',
246 246
 		);
247 247
 
248
-		$this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/media/listtypes', array( 'default' ) );
248
+		$this->context->getConfig()->set('controller/common/catalog/import/csv/processor/media/listtypes', array('default'));
249 249
 
250
-		$catalog = $this->create( 'job_csv_test' );
250
+		$catalog = $this->create('job_csv_test');
251 251
 
252
-		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
253
-		$object->process( $catalog, $data );
252
+		$object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
253
+		$object->process($catalog, $data);
254 254
 
255 255
 
256 256
 		$listItems = $catalog->getListItems();
257
-		$listItem = reset( $listItems );
257
+		$listItem = reset($listItems);
258 258
 
259
-		$this->assertEquals( 1, count( $listItems ) );
260
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
259
+		$this->assertEquals(1, count($listItems));
260
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
261 261
 
262
-		$this->assertEquals( 'default', $listItem->getType() );
263
-		$this->assertEquals( 'path/to/file2', $listItem->getRefItem()->getUrl() );
262
+		$this->assertEquals('default', $listItem->getType());
263
+		$this->assertEquals('path/to/file2', $listItem->getRefItem()->getUrl());
264 264
 	}
265 265
 
266 266
 
267 267
 	/**
268 268
 	 * @param string $code
269 269
 	 */
270
-	protected function create( $code )
270
+	protected function create($code)
271 271
 	{
272
-		$manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context );
272
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context);
273 273
 
274 274
 		$item = $manager->createItem();
275
-		$item->setCode( $code );
275
+		$item->setCode($code);
276 276
 
277 277
 		return $item;
278 278
 	}
Please login to merge, or discard this patch.
jobs/tests/Controller/Jobs/Product/Export/Sitemap/StandardTest.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -18,18 +18,18 @@  discard block
 block discarded – undo
18 18
 
19 19
 	protected function setUp()
20 20
 	{
21
-		\Aimeos\MShop\Factory::setCache( true );
21
+		\Aimeos\MShop\Factory::setCache(true);
22 22
 
23 23
 		$this->context = \TestHelperJobs::getContext();
24 24
 		$this->aimeos = \TestHelperJobs::getAimeos();
25 25
 
26
-		$this->object = new \Aimeos\Controller\Jobs\Product\Export\Sitemap\Standard( $this->context, $this->aimeos );
26
+		$this->object = new \Aimeos\Controller\Jobs\Product\Export\Sitemap\Standard($this->context, $this->aimeos);
27 27
 	}
28 28
 
29 29
 
30 30
 	protected function tearDown()
31 31
 	{
32
-		\Aimeos\MShop\Factory::setCache( false );
32
+		\Aimeos\MShop\Factory::setCache(false);
33 33
 		\Aimeos\MShop\Factory::clear();
34 34
 
35 35
 		$this->object = null;
@@ -38,40 +38,40 @@  discard block
 block discarded – undo
38 38
 
39 39
 	public function testGetName()
40 40
 	{
41
-		$this->assertEquals( 'Product site map', $this->object->getName() );
41
+		$this->assertEquals('Product site map', $this->object->getName());
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testGetDescription()
46 46
 	{
47 47
 		$text = 'Creates a product site map for search engines';
48
-		$this->assertEquals( $text, $this->object->getDescription() );
48
+		$this->assertEquals($text, $this->object->getDescription());
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testRun()
53 53
 	{
54
-		$this->context->getConfig()->set( 'controller/jobs/product/export/sitemap/max-items', 5 );
54
+		$this->context->getConfig()->set('controller/jobs/product/export/sitemap/max-items', 5);
55 55
 
56 56
 		$this->object->run();
57 57
 
58 58
 		$ds = DIRECTORY_SEPARATOR;
59
-		$this->assertFileExists( 'tmp' . $ds . 'aimeos-sitemap-1.xml.gz' );
60
-		$this->assertFileExists( 'tmp' . $ds . 'aimeos-sitemap-2.xml.gz' );
61
-		$this->assertFileExists( 'tmp' . $ds . 'aimeos-sitemap-index.xml.gz' );
59
+		$this->assertFileExists('tmp' . $ds . 'aimeos-sitemap-1.xml.gz');
60
+		$this->assertFileExists('tmp' . $ds . 'aimeos-sitemap-2.xml.gz');
61
+		$this->assertFileExists('tmp' . $ds . 'aimeos-sitemap-index.xml.gz');
62 62
 
63
-		$file1 = gzread( gzopen( 'tmp' . $ds . 'aimeos-sitemap-1.xml.gz', 'rb' ), 0x1000 );
64
-		$file2 = gzread( gzopen( 'tmp' . $ds . 'aimeos-sitemap-2.xml.gz', 'rb' ), 0x1000 );
65
-		$index = gzread( gzopen( 'tmp' . $ds . 'aimeos-sitemap-index.xml.gz', 'rb' ), 0x1000 );
63
+		$file1 = gzread(gzopen('tmp' . $ds . 'aimeos-sitemap-1.xml.gz', 'rb'), 0x1000);
64
+		$file2 = gzread(gzopen('tmp' . $ds . 'aimeos-sitemap-2.xml.gz', 'rb'), 0x1000);
65
+		$index = gzread(gzopen('tmp' . $ds . 'aimeos-sitemap-index.xml.gz', 'rb'), 0x1000);
66 66
 
67
-		unlink( 'tmp' . $ds . 'aimeos-sitemap-1.xml.gz' );
68
-		unlink( 'tmp' . $ds . 'aimeos-sitemap-2.xml.gz' );
69
-		unlink( 'tmp' . $ds . 'aimeos-sitemap-index.xml.gz' );
67
+		unlink('tmp' . $ds . 'aimeos-sitemap-1.xml.gz');
68
+		unlink('tmp' . $ds . 'aimeos-sitemap-2.xml.gz');
69
+		unlink('tmp' . $ds . 'aimeos-sitemap-index.xml.gz');
70 70
 
71
-		$this->assertContains( 'Cafe_Noire_Expresso', $file2 );
72
-		$this->assertContains( 'Unittest%3A_Bundle', $file2 );
71
+		$this->assertContains('Cafe_Noire_Expresso', $file2);
72
+		$this->assertContains('Unittest%3A_Bundle', $file2);
73 73
 
74
-		$this->assertContains( 'aimeos-sitemap-1.xml.gz', $index );
75
-		$this->assertContains( 'aimeos-sitemap-2.xml.gz', $index );
74
+		$this->assertContains('aimeos-sitemap-1.xml.gz', $index);
75
+		$this->assertContains('aimeos-sitemap-2.xml.gz', $index);
76 76
 	}
77 77
 }
78 78
\ No newline at end of file
Please login to merge, or discard this patch.
Controller/Common/Product/Import/Csv/Processor/Property/StandardTest.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(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\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -49,26 +49,26 @@  discard block
 block discarded – undo
49 49
 			4 => '50',
50 50
 		);
51 51
 
52
-		$product = $this->create( 'job_csv_test' );
52
+		$product = $this->create('job_csv_test');
53 53
 
54
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
55
-		$object->process( $product, $data );
54
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
55
+		$object->process($product, $data);
56 56
 
57 57
 
58 58
 		$pos = 0;
59 59
 		$expected = array(
60
-			array( 'package-weight', '3.00', 'de' ),
61
-			array( 'package-width', '50', null ),
60
+			array('package-weight', '3.00', 'de'),
61
+			array('package-width', '50', null),
62 62
 		);
63 63
 
64 64
 		$items = $product->getPropertyItems();
65
-		$this->assertEquals( 2, count( $items ) );
65
+		$this->assertEquals(2, count($items));
66 66
 
67
-		foreach( $items as $item )
67
+		foreach ($items as $item)
68 68
 		{
69
-			$this->assertEquals( $expected[$pos][0], $item->getType() );
70
-			$this->assertEquals( $expected[$pos][1], $item->getValue() );
71
-			$this->assertEquals( $expected[$pos][2], $item->getLanguageId() );
69
+			$this->assertEquals($expected[$pos][0], $item->getType());
70
+			$this->assertEquals($expected[$pos][1], $item->getValue());
71
+			$this->assertEquals($expected[$pos][2], $item->getLanguageId());
72 72
 			$pos++;
73 73
 		}
74 74
 	}
@@ -91,21 +91,21 @@  discard block
 block discarded – undo
91 91
 			1 => '10',
92 92
 		);
93 93
 
94
-		$product = $this->create( 'job_csv_test' );
94
+		$product = $this->create('job_csv_test');
95 95
 
96
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
97
-		$object->process( $product, $data );
98
-		$object->process( $product, $dataUpdate );
96
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
97
+		$object->process($product, $data);
98
+		$object->process($product, $dataUpdate);
99 99
 
100 100
 
101 101
 		$items = $product->getPropertyItems();
102
-		$item = reset( $items );
102
+		$item = reset($items);
103 103
 
104
-		$this->assertEquals( 1, count( $items ) );
105
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item );
104
+		$this->assertEquals(1, count($items));
105
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Property\\Iface', $item);
106 106
 
107
-		$this->assertEquals( 'package-height', $item->getType() );
108
-		$this->assertEquals( '10', $item->getValue() );
107
+		$this->assertEquals('package-height', $item->getType());
108
+		$this->assertEquals('10', $item->getValue());
109 109
 	}
110 110
 
111 111
 
@@ -121,18 +121,18 @@  discard block
 block discarded – undo
121 121
 			1 => '3.00',
122 122
 		);
123 123
 
124
-		$product = $this->create( 'job_csv_test' );
124
+		$product = $this->create('job_csv_test');
125 125
 
126
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
127
-		$object->process( $product, $data );
126
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
127
+		$object->process($product, $data);
128 128
 
129
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, [], $this->endpoint );
130
-		$object->process( $product, [] );
129
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, [], $this->endpoint);
130
+		$object->process($product, []);
131 131
 
132 132
 
133 133
 		$items = $product->getPropertyItems();
134 134
 
135
-		$this->assertEquals( 0, count( $items ) );
135
+		$this->assertEquals(0, count($items));
136 136
 	}
137 137
 
138 138
 
@@ -152,23 +152,23 @@  discard block
 block discarded – undo
152 152
 			3 => '3.00',
153 153
 		);
154 154
 
155
-		$product = $this->create( 'job_csv_test' );
155
+		$product = $this->create('job_csv_test');
156 156
 
157
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard( $this->context, $mapping, $this->endpoint );
158
-		$object->process( $product, $data );
157
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Property\Standard($this->context, $mapping, $this->endpoint);
158
+		$object->process($product, $data);
159 159
 
160 160
 		$items = $product->getPropertyItems();
161 161
 
162
-		$this->assertEquals( 1, count( $items ) );
162
+		$this->assertEquals(1, count($items));
163 163
 	}
164 164
 
165 165
 
166 166
 	/**
167 167
 	 * @param string $code
168 168
 	 */
169
-	protected function create( $code )
169
+	protected function create($code)
170 170
 	{
171
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
172
-		return $manager->createItem()->setCode( $code );
171
+		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context);
172
+		return $manager->createItem()->setCode($code);
173 173
 	}
174 174
 }
175 175
\ No newline at end of file
Please login to merge, or discard this patch.
tests/Controller/Common/Product/Import/Csv/Processor/Media/StandardTest.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(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\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -51,31 +51,31 @@  discard block
 block discarded – undo
51 51
 			5 => 1,
52 52
 		);
53 53
 
54
-		$product = $this->create( 'job_csv_test' );
54
+		$product = $this->create('job_csv_test');
55 55
 
56
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
57
-		$object->process( $product, $data );
56
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
57
+		$object->process($product, $data);
58 58
 
59 59
 
60 60
 		$listItems = $product->getListItems();
61
-		$listItem = reset( $listItems );
61
+		$listItem = reset($listItems);
62 62
 
63
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
64
-		$this->assertEquals( 1, count( $listItems ) );
63
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
64
+		$this->assertEquals(1, count($listItems));
65 65
 
66
-		$this->assertEquals( 1, $listItem->getStatus() );
67
-		$this->assertEquals( 0, $listItem->getPosition() );
68
-		$this->assertEquals( 'default', $listItem->getType() );
66
+		$this->assertEquals(1, $listItem->getStatus());
67
+		$this->assertEquals(0, $listItem->getPosition());
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
 block discarded – undo
89 89
 			0 => "path/to/0\npath/to/1\npath/to/2\npath/to/3",
90 90
 		);
91 91
 
92
-		$product = $this->create( 'job_csv_test' );
92
+		$product = $this->create('job_csv_test');
93 93
 
94
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
95
-		$object->process( $product, $data );
94
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
95
+		$object->process($product, $data);
96 96
 
97 97
 
98 98
 		$pos = 0;
99 99
 		$listItems = $product->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
 block discarded – undo
125 125
 			3 => 'path/to/3',
126 126
 		);
127 127
 
128
-		$product = $this->create( 'job_csv_test' );
128
+		$product = $this->create('job_csv_test');
129 129
 
130
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
131
-		$object->process( $product, $data );
130
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
131
+		$object->process($product, $data);
132 132
 
133 133
 
134 134
 		$pos = 0;
135 135
 		$listItems = $product->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
 block discarded – undo
161 161
 			1 => '',
162 162
 		);
163 163
 
164
-		$product = $this->create( 'job_csv_test' );
164
+		$product = $this->create('job_csv_test');
165 165
 
166
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
167
-		$object->process( $product, $data );
168
-		$object->process( $product, $dataUpdate );
166
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
167
+		$object->process($product, $data);
168
+		$object->process($product, $dataUpdate);
169 169
 
170 170
 
171 171
 		$listItems = $product->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
 block discarded – undo
189 189
 			0 => '/path/to/file',
190 190
 		);
191 191
 
192
-		$product = $this->create( 'job_csv_test' );
192
+		$product = $this->create('job_csv_test');
193 193
 
194
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
195
-		$object->process( $product, $data );
194
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
195
+		$object->process($product, $data);
196 196
 
197
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, [], $this->endpoint );
198
-		$object->process( $product, [] );
197
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, [], $this->endpoint);
198
+		$object->process($product, []);
199 199
 
200 200
 
201 201
 		$listItems = $product->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
 block discarded – undo
216 216
 			1 => '',
217 217
 		);
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\Media\Standard( $this->context, $mapping, $this->endpoint );
222
-		$object->process( $product, $data );
221
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
222
+		$object->process($product, $data);
223 223
 
224 224
 
225 225
 		$listItems = $product->getListItems();
226 226
 
227
-		$this->assertEquals( 1, count( $listItems ) );
227
+		$this->assertEquals(1, count($listItems));
228 228
 	}
229 229
 
230 230
 
@@ -244,31 +244,31 @@  discard block
 block discarded – undo
244 244
 			3 => 'default',
245 245
 		);
246 246
 
247
-		$this->context->getConfig()->set( 'controller/common/product/import/csv/processor/media/listtypes', array( 'default' ) );
247
+		$this->context->getConfig()->set('controller/common/product/import/csv/processor/media/listtypes', array('default'));
248 248
 
249
-		$product = $this->create( 'job_csv_test' );
249
+		$product = $this->create('job_csv_test');
250 250
 
251
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint );
252
-		$object->process( $product, $data );
251
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint);
252
+		$object->process($product, $data);
253 253
 
254 254
 
255 255
 		$listItems = $product->getListItems();
256
-		$listItem = reset( $listItems );
256
+		$listItem = reset($listItems);
257 257
 
258
-		$this->assertEquals( 1, count( $listItems ) );
259
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
258
+		$this->assertEquals(1, count($listItems));
259
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
260 260
 
261
-		$this->assertEquals( 'default', $listItem->getType() );
262
-		$this->assertEquals( 'path/to/file2', $listItem->getRefItem()->getUrl() );
261
+		$this->assertEquals('default', $listItem->getType());
262
+		$this->assertEquals('path/to/file2', $listItem->getRefItem()->getUrl());
263 263
 	}
264 264
 
265 265
 
266 266
 	/**
267 267
 	 * @param string $code
268 268
 	 */
269
-	protected function create( $code )
269
+	protected function create($code)
270 270
 	{
271
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
272
-		return $manager->createItem()->setCode( $code );
271
+		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context);
272
+		return $manager->createItem()->setCode($code);
273 273
 	}
274 274
 }
275 275
\ No newline at end of file
Please login to merge, or discard this patch.
Controller/Common/Product/Import/Csv/Processor/Product/StandardTest.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -18,17 +18,17 @@  discard block
 block discarded – undo
18 18
 
19 19
 	protected function setUp()
20 20
 	{
21
-		\Aimeos\MShop\Factory::setCache( true );
21
+		\Aimeos\MShop\Factory::setCache(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\Factory::createManager( $this->context, 'product' );
26
+		$manager = \Aimeos\MShop\Factory::createManager($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
 block discarded – undo
36 36
 
37 37
 	protected function tearDown()
38 38
 	{
39
-		\Aimeos\MShop\Factory::setCache( false );
39
+		\Aimeos\MShop\Factory::setCache(false);
40 40
 		\Aimeos\MShop\Factory::clear();
41 41
 	}
42 42
 
@@ -57,23 +57,23 @@  discard block
 block discarded – undo
57 57
 			3 => 'CNE',
58 58
 		);
59 59
 
60
-		$product = $this->create( 'job_csv_test' );
60
+		$product = $this->create('job_csv_test');
61 61
 
62
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
63
-		$object->process( $product, $data );
62
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
63
+		$object->process($product, $data);
64 64
 
65 65
 
66
-		$listItems1 = $product->getListItems( 'product', 'default' );
67
-		$listItems2 = $product->getListItems( 'product', 'suggestion' );
66
+		$listItems1 = $product->getListItems('product', 'default');
67
+		$listItems2 = $product->getListItems('product', 'suggestion');
68 68
 
69
-		$this->assertEquals( 1, count( $listItems1 ) );
70
-		$this->assertEquals( 1, count( $listItems2 ) );
69
+		$this->assertEquals(1, count($listItems1));
70
+		$this->assertEquals(1, count($listItems2));
71 71
 
72
-		$this->assertEquals( 1, reset( $listItems1 )->getStatus() );
73
-		$this->assertEquals( 1, reset( $listItems2 )->getStatus() );
72
+		$this->assertEquals(1, reset($listItems1)->getStatus());
73
+		$this->assertEquals(1, reset($listItems2)->getStatus());
74 74
 
75
-		$this->assertEquals( $this->products['CNC'], reset( $listItems1 )->getRefId() );
76
-		$this->assertEquals( $this->products['CNE'], reset( $listItems2 )->getRefId() );
75
+		$this->assertEquals($this->products['CNC'], reset($listItems1)->getRefId());
76
+		$this->assertEquals($this->products['CNE'], reset($listItems2)->getRefId());
77 77
 	}
78 78
 
79 79
 
@@ -89,24 +89,24 @@  discard block
 block discarded – undo
89 89
 			1 => "CNC\nCNE",
90 90
 		);
91 91
 
92
-		$product = $this->create( 'job_csv_test' );
92
+		$product = $this->create('job_csv_test');
93 93
 
94
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
95
-		$object->process( $product, $data );
94
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
95
+		$object->process($product, $data);
96 96
 
97 97
 
98 98
 		$pos = 0;
99 99
 		$listItems = $product->getListItems();
100
-		$prodIds = array( $this->products['CNC'], $this->products['CNE'] );
100
+		$prodIds = array($this->products['CNC'], $this->products['CNE']);
101 101
 
102
-		$this->assertEquals( 2, count( $listItems ) );
102
+		$this->assertEquals(2, count($listItems));
103 103
 
104
-		foreach( $listItems as $listItem )
104
+		foreach ($listItems as $listItem)
105 105
 		{
106
-			$this->assertEquals( 1, $listItem->getStatus() );
107
-			$this->assertEquals( 'product', $listItem->getDomain() );
108
-			$this->assertEquals( 'default', $listItem->getType() );
109
-			$this->assertEquals( $prodIds[$pos], $listItem->getRefId() );
106
+			$this->assertEquals(1, $listItem->getStatus());
107
+			$this->assertEquals('product', $listItem->getDomain());
108
+			$this->assertEquals('default', $listItem->getType());
109
+			$this->assertEquals($prodIds[$pos], $listItem->getRefId());
110 110
 			$pos++;
111 111
 		}
112 112
 	}
@@ -129,20 +129,20 @@  discard block
 block discarded – undo
129 129
 			1 => 'CNE',
130 130
 		);
131 131
 
132
-		$product = $this->create( 'job_csv_test' );
132
+		$product = $this->create('job_csv_test');
133 133
 
134
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
135
-		$object->process( $product, $data );
136
-		$object->process( $product, $dataUpdate );
134
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
135
+		$object->process($product, $data);
136
+		$object->process($product, $dataUpdate);
137 137
 
138 138
 
139 139
 		$listItems = $product->getListItems();
140
-		$listItem = reset( $listItems );
140
+		$listItem = reset($listItems);
141 141
 
142
-		$this->assertEquals( 1, count( $listItems ) );
143
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
142
+		$this->assertEquals(1, count($listItems));
143
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
144 144
 
145
-		$this->assertEquals( $this->products['CNE'], $listItem->getRefId() );
145
+		$this->assertEquals($this->products['CNE'], $listItem->getRefId());
146 146
 	}
147 147
 
148 148
 
@@ -158,16 +158,16 @@  discard block
 block discarded – undo
158 158
 			1 => 'CNC',
159 159
 		);
160 160
 
161
-		$product = $this->create( 'job_csv_test' );
161
+		$product = $this->create('job_csv_test');
162 162
 
163
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
164
-		$object->process( $product, $data );
163
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
164
+		$object->process($product, $data);
165 165
 
166
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, [], $this->endpoint );
167
-		$object->process( $product, [] );
166
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, [], $this->endpoint);
167
+		$object->process($product, []);
168 168
 
169 169
 
170
-		$this->assertEquals( 0, count( $product->getListItems() ) );
170
+		$this->assertEquals(0, count($product->getListItems()));
171 171
 	}
172 172
 
173 173
 
@@ -187,15 +187,15 @@  discard block
 block discarded – undo
187 187
 			3 => 'CNE',
188 188
 		);
189 189
 
190
-		$product = $this->create( 'job_csv_test' );
190
+		$product = $this->create('job_csv_test');
191 191
 
192
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
193
-		$object->process( $product, $data );
192
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
193
+		$object->process($product, $data);
194 194
 
195 195
 
196 196
 		$listItems = $product->getListItems();
197 197
 
198
-		$this->assertEquals( 1, count( $listItems ) );
198
+		$this->assertEquals(1, count($listItems));
199 199
 	}
200 200
 
201 201
 
@@ -215,31 +215,31 @@  discard block
 block discarded – undo
215 215
 			3 => 'CNE',
216 216
 		);
217 217
 
218
-		$this->context->getConfig()->set( 'controller/common/product/import/csv/processor/product/listtypes', array( 'default' ) );
218
+		$this->context->getConfig()->set('controller/common/product/import/csv/processor/product/listtypes', array('default'));
219 219
 
220
-		$product = $this->create( 'job_csv_test' );
220
+		$product = $this->create('job_csv_test');
221 221
 
222
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard( $this->context, $mapping, $this->endpoint );
223
-		$object->process( $product, $data );
222
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Product\Standard($this->context, $mapping, $this->endpoint);
223
+		$object->process($product, $data);
224 224
 
225 225
 
226 226
 		$listItems = $product->getListItems();
227
-		$listItem = reset( $listItems );
227
+		$listItem = reset($listItems);
228 228
 
229
-		$this->assertEquals( 1, count( $listItems ) );
230
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
229
+		$this->assertEquals(1, count($listItems));
230
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
231 231
 
232
-		$this->assertEquals( 'default', $listItem->getType() );
233
-		$this->assertEquals( $this->products['CNE'], $listItem->getRefId() );
232
+		$this->assertEquals('default', $listItem->getType());
233
+		$this->assertEquals($this->products['CNE'], $listItem->getRefId());
234 234
 	}
235 235
 
236 236
 
237 237
 	/**
238 238
 	 * @param string $code
239 239
 	 */
240
-	protected function create( $code )
240
+	protected function create($code)
241 241
 	{
242
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
243
-		return $manager->createItem()->setCode( $code );
242
+		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context);
243
+		return $manager->createItem()->setCode($code);
244 244
 	}
245 245
 }
Please login to merge, or discard this patch.
tests/Controller/Common/Product/Import/Csv/Processor/Price/StandardTest.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(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\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -57,33 +57,33 @@  discard block
 block discarded – undo
57 57
 			8 => 1,
58 58
 		);
59 59
 
60
-		$product = $this->create( 'job_csv_test' );
60
+		$product = $this->create('job_csv_test');
61 61
 
62
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint );
63
-		$object->process( $product, $data );
62
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint);
63
+		$object->process($product, $data);
64 64
 
65 65
 
66 66
 		$listItems = $product->getListItems();
67
-		$listItem = reset( $listItems );
67
+		$listItem = reset($listItems);
68 68
 
69
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
70
-		$this->assertEquals( 1, count( $listItems ) );
69
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
70
+		$this->assertEquals(1, count($listItems));
71 71
 
72
-		$this->assertEquals( 1, $listItem->getStatus() );
73
-		$this->assertEquals( 0, $listItem->getPosition() );
74
-		$this->assertEquals( 'default', $listItem->getType() );
72
+		$this->assertEquals(1, $listItem->getStatus());
73
+		$this->assertEquals(0, $listItem->getPosition());
74
+		$this->assertEquals('default', $listItem->getType());
75 75
 
76 76
 		$refItem = $listItem->getRefItem();
77 77
 
78
-		$this->assertEquals( 1, $refItem->getStatus() );
79
-		$this->assertEquals( 'default', $refItem->getType() );
80
-		$this->assertEquals( 'EUR 1.00', $refItem->getLabel() );
81
-		$this->assertEquals( 5, $refItem->getQuantity() );
82
-		$this->assertEquals( '1.00', $refItem->getValue() );
83
-		$this->assertEquals( '0.20', $refItem->getCosts() );
84
-		$this->assertEquals( '0.10', $refItem->getRebate() );
85
-		$this->assertEquals( '20.00', $refItem->getTaxrate() );
86
-		$this->assertEquals( 1, $refItem->getStatus() );
78
+		$this->assertEquals(1, $refItem->getStatus());
79
+		$this->assertEquals('default', $refItem->getType());
80
+		$this->assertEquals('EUR 1.00', $refItem->getLabel());
81
+		$this->assertEquals(5, $refItem->getQuantity());
82
+		$this->assertEquals('1.00', $refItem->getValue());
83
+		$this->assertEquals('0.20', $refItem->getCosts());
84
+		$this->assertEquals('0.10', $refItem->getRebate());
85
+		$this->assertEquals('20.00', $refItem->getTaxrate());
86
+		$this->assertEquals(1, $refItem->getStatus());
87 87
 	}
88 88
 
89 89
 
@@ -111,21 +111,21 @@  discard block
 block discarded – undo
111 111
 			7 => '4.00',
112 112
 		);
113 113
 
114
-		$product = $this->create( 'job_csv_test' );
114
+		$product = $this->create('job_csv_test');
115 115
 
116
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint );
117
-		$object->process( $product, $data );
116
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint);
117
+		$object->process($product, $data);
118 118
 
119 119
 
120 120
 		$pos = 0;
121 121
 		$listItems = $product->getListItems();
122 122
 
123
-		$this->assertEquals( 4, count( $listItems ) );
123
+		$this->assertEquals(4, count($listItems));
124 124
 
125
-		foreach( $listItems as $listItem )
125
+		foreach ($listItems as $listItem)
126 126
 		{
127
-			$this->assertEquals( $data[$pos++], $listItem->getRefItem()->getCurrencyId() );
128
-			$this->assertEquals( $data[$pos++], $listItem->getRefItem()->getValue() );
127
+			$this->assertEquals($data[$pos++], $listItem->getRefItem()->getCurrencyId());
128
+			$this->assertEquals($data[$pos++], $listItem->getRefItem()->getValue());
129 129
 		}
130 130
 	}
131 131
 
@@ -147,20 +147,20 @@  discard block
 block discarded – undo
147 147
 			1 => '2.00',
148 148
 		);
149 149
 
150
-		$product = $this->create( 'job_csv_test' );
150
+		$product = $this->create('job_csv_test');
151 151
 
152
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint );
153
-		$object->process( $product, $data );
154
-		$object->process( $product, $dataUpdate );
152
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint);
153
+		$object->process($product, $data);
154
+		$object->process($product, $dataUpdate);
155 155
 
156 156
 
157 157
 		$listItems = $product->getListItems();
158
-		$listItem = reset( $listItems );
158
+		$listItem = reset($listItems);
159 159
 
160
-		$this->assertEquals( 1, count( $listItems ) );
161
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
160
+		$this->assertEquals(1, count($listItems));
161
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
162 162
 
163
-		$this->assertEquals( '2.00', $listItem->getRefItem()->getValue() );
163
+		$this->assertEquals('2.00', $listItem->getRefItem()->getValue());
164 164
 	}
165 165
 
166 166
 
@@ -176,18 +176,18 @@  discard block
 block discarded – undo
176 176
 			1 => '1.00',
177 177
 		);
178 178
 
179
-		$product = $this->create( 'job_csv_test' );
179
+		$product = $this->create('job_csv_test');
180 180
 
181
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint );
182
-		$object->process( $product, $data );
181
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint);
182
+		$object->process($product, $data);
183 183
 
184
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, [], $this->endpoint );
185
-		$object->process( $product, [] );
184
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, [], $this->endpoint);
185
+		$object->process($product, []);
186 186
 
187 187
 
188 188
 		$listItems = $product->getListItems();
189 189
 
190
-		$this->assertEquals( 0, count( $listItems ) );
190
+		$this->assertEquals(0, count($listItems));
191 191
 	}
192 192
 
193 193
 
@@ -207,15 +207,15 @@  discard block
 block discarded – undo
207 207
 			3 => '',
208 208
 		);
209 209
 
210
-		$product = $this->create( 'job_csv_test' );
210
+		$product = $this->create('job_csv_test');
211 211
 
212
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint );
213
-		$object->process( $product, $data );
212
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint);
213
+		$object->process($product, $data);
214 214
 
215 215
 
216 216
 		$listItems = $product->getListItems();
217 217
 
218
-		$this->assertEquals( 1, count( $listItems ) );
218
+		$this->assertEquals(1, count($listItems));
219 219
 	}
220 220
 
221 221
 
@@ -239,31 +239,31 @@  discard block
 block discarded – undo
239 239
 			5 => 'default',
240 240
 		);
241 241
 
242
-		$this->context->getConfig()->set( 'controller/common/product/import/csv/processor/price/listtypes', array( 'default' ) );
242
+		$this->context->getConfig()->set('controller/common/product/import/csv/processor/price/listtypes', array('default'));
243 243
 
244
-		$product = $this->create( 'job_csv_test' );
244
+		$product = $this->create('job_csv_test');
245 245
 
246
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard( $this->context, $mapping, $this->endpoint );
247
-		$object->process( $product, $data );
246
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Price\Standard($this->context, $mapping, $this->endpoint);
247
+		$object->process($product, $data);
248 248
 
249 249
 
250 250
 		$listItems = $product->getListItems();
251
-		$listItem = reset( $listItems );
251
+		$listItem = reset($listItems);
252 252
 
253
-		$this->assertEquals( 1, count( $listItems ) );
254
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
253
+		$this->assertEquals(1, count($listItems));
254
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
255 255
 
256
-		$this->assertEquals( 'default', $listItem->getType() );
257
-		$this->assertEquals( '2.00', $listItem->getRefItem()->getValue() );
256
+		$this->assertEquals('default', $listItem->getType());
257
+		$this->assertEquals('2.00', $listItem->getRefItem()->getValue());
258 258
 	}
259 259
 
260 260
 
261 261
 	/**
262 262
 	 * @param string $code
263 263
 	 */
264
-	protected function create( $code )
264
+	protected function create($code)
265 265
 	{
266
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
267
-		return $manager->createItem()->setCode( $code );
266
+		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context);
267
+		return $manager->createItem()->setCode($code);
268 268
 	}
269 269
 }
270 270
\ No newline at end of file
Please login to merge, or discard this patch.
tests/Controller/Common/Product/Import/Csv/Processor/Text/StandardTest.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(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\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -49,30 +49,30 @@  discard block
 block discarded – undo
49 49
 			4 => 1,
50 50
 		);
51 51
 
52
-		$product = $this->create( 'job_csv_test' );
52
+		$product = $this->create('job_csv_test');
53 53
 
54
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
55
-		$object->process( $product, $data );
54
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
55
+		$object->process($product, $data);
56 56
 
57 57
 
58 58
 		$listItems = $product->getListItems();
59
-		$listItem = reset( $listItems );
59
+		$listItem = reset($listItems);
60 60
 
61
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
62
-		$this->assertEquals( 1, count( $listItems ) );
61
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
62
+		$this->assertEquals(1, count($listItems));
63 63
 
64
-		$this->assertEquals( 1, $listItem->getStatus() );
65
-		$this->assertEquals( 0, $listItem->getPosition() );
66
-		$this->assertEquals( 'default', $listItem->getType() );
64
+		$this->assertEquals(1, $listItem->getStatus());
65
+		$this->assertEquals(0, $listItem->getPosition());
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
 block discarded – undo
100 100
 			7 => 'Long: Job CSV test 2',
101 101
 		);
102 102
 
103
-		$product = $this->create( 'job_csv_test' );
103
+		$product = $this->create('job_csv_test');
104 104
 
105
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
106
-		$object->process( $product, $data );
105
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
106
+		$object->process($product, $data);
107 107
 
108 108
 
109 109
 		$pos = 0;
110 110
 		$listItems = $product->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
 block discarded – undo
143 143
 			1 => 'Short: Job CSV test',
144 144
 		);
145 145
 
146
-		$product = $this->create( 'job_csv_test' );
146
+		$product = $this->create('job_csv_test');
147 147
 
148
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
149
-		$object->process( $product, $data );
150
-		$object->process( $product, $dataUpdate );
148
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
149
+		$object->process($product, $data);
150
+		$object->process($product, $dataUpdate);
151 151
 
152 152
 
153 153
 		$listItems = $product->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
 block discarded – undo
173 173
 			1 => 'Job CSV test',
174 174
 		);
175 175
 
176
-		$product = $this->create( 'job_csv_test' );
176
+		$product = $this->create('job_csv_test');
177 177
 
178
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
179
-		$object->process( $product, $data );
178
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
179
+		$object->process($product, $data);
180 180
 
181
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard( $this->context, [], $this->endpoint );
182
-		$object->process( $product, [] );
181
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard($this->context, [], $this->endpoint);
182
+		$object->process($product, []);
183 183
 
184 184
 
185 185
 		$listItems = $product->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
 block discarded – undo
204 204
 			3 => '',
205 205
 		);
206 206
 
207
-		$product = $this->create( 'job_csv_test' );
207
+		$product = $this->create('job_csv_test');
208 208
 
209
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
210
-		$object->process( $product, $data );
209
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
210
+		$object->process($product, $data);
211 211
 
212 212
 
213 213
 		$listItems = $product->getListItems();
214 214
 
215
-		$this->assertEquals( 1, count( $listItems ) );
215
+		$this->assertEquals(1, count($listItems));
216 216
 	}
217 217
 
218 218
 
@@ -236,32 +236,32 @@  discard block
 block discarded – undo
236 236
 			5 => 'default',
237 237
 		);
238 238
 
239
-		$this->context->getConfig()->set( 'controller/common/product/import/csv/processor/text/listtypes', array( 'default' ) );
239
+		$this->context->getConfig()->set('controller/common/product/import/csv/processor/text/listtypes', array('default'));
240 240
 
241
-		$product = $this->create( 'job_csv_test' );
241
+		$product = $this->create('job_csv_test');
242 242
 
243
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint );
244
-		$object->process( $product, $data );
243
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint);
244
+		$object->process($product, $data);
245 245
 
246 246
 
247 247
 		$listItems = $product->getListItems();
248
-		$listItem = reset( $listItems );
248
+		$listItem = reset($listItems);
249 249
 
250
-		$this->assertEquals( 1, count( $listItems ) );
251
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
250
+		$this->assertEquals(1, count($listItems));
251
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
252 252
 
253
-		$this->assertEquals( 'default', $listItem->getType() );
254
-		$this->assertEquals( 'short', $listItem->getRefItem()->getType() );
255
-		$this->assertEquals( 'test short', $listItem->getRefItem()->getContent() );
253
+		$this->assertEquals('default', $listItem->getType());
254
+		$this->assertEquals('short', $listItem->getRefItem()->getType());
255
+		$this->assertEquals('test short', $listItem->getRefItem()->getContent());
256 256
 	}
257 257
 
258 258
 
259 259
 	/**
260 260
 	 * @param string $code
261 261
 	 */
262
-	protected function create( $code )
262
+	protected function create($code)
263 263
 	{
264
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
265
-		return $manager->createItem()->setCode( $code );
264
+		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context);
265
+		return $manager->createItem()->setCode($code);
266 266
 	}
267 267
 }
268 268
\ No newline at end of file
Please login to merge, or discard this patch.
Controller/Common/Product/Import/Csv/Processor/Attribute/StandardTest.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(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\Factory::setCache( false );
29
+		\Aimeos\MShop\Factory::setCache(false);
30 30
 		\Aimeos\MShop\Factory::clear();
31 31
 	}
32 32
 
@@ -57,29 +57,29 @@  discard block
 block discarded – undo
57 57
 			8 => 'variant',
58 58
 		);
59 59
 
60
-		$product = $this->create( 'job_csv_test' );
60
+		$product = $this->create('job_csv_test');
61 61
 
62
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint );
63
-		$object->process( $product, $data );
62
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint);
63
+		$object->process($product, $data);
64 64
 
65 65
 
66 66
 		$pos = 0;
67 67
 		$listItems = $product->getListItems();
68 68
 		$expected = array(
69
-			array( 'variant', 'length', '30' ),
70
-			array( 'variant', 'width', '29' ),
71
-			array( 'variant', 'color', 'white' ),
69
+			array('variant', 'length', '30'),
70
+			array('variant', 'width', '29'),
71
+			array('variant', 'color', 'white'),
72 72
 		);
73 73
 
74
-		$this->assertEquals( 3, count( $listItems ) );
74
+		$this->assertEquals(3, count($listItems));
75 75
 
76
-		foreach( $listItems as $listItem )
76
+		foreach ($listItems as $listItem)
77 77
 		{
78
-			$this->assertEquals( 1, $listItem->getStatus() );
79
-			$this->assertEquals( 'attribute', $listItem->getDomain() );
80
-			$this->assertEquals( $expected[$pos][0], $listItem->getType() );
81
-			$this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getType() );
82
-			$this->assertEquals( $expected[$pos][2], $listItem->getRefItem()->getCode() );
78
+			$this->assertEquals(1, $listItem->getStatus());
79
+			$this->assertEquals('attribute', $listItem->getDomain());
80
+			$this->assertEquals($expected[$pos][0], $listItem->getType());
81
+			$this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getType());
82
+			$this->assertEquals($expected[$pos][2], $listItem->getRefItem()->getCode());
83 83
 			$pos++;
84 84
 		}
85 85
 	}
@@ -99,25 +99,25 @@  discard block
 block discarded – undo
99 99
 			2 => 'variant',
100 100
 		);
101 101
 
102
-		$product = $this->create( 'job_csv_test' );
102
+		$product = $this->create('job_csv_test');
103 103
 
104
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard( $this->context, $mapping, $this->endpoint );
105
-		$object->process( $product, $data );
104
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Catalog\Standard($this->context, $mapping, $this->endpoint);
105
+		$object->process($product, $data);
106 106
 
107 107
 
108 108
 		$pos = 0;
109
-		$codes = array( 'white', 'black', 'aimeos' );
109
+		$codes = array('white', 'black', 'aimeos');
110 110
 
111
-		foreach( $product->getListItems() as $listItems )
111
+		foreach ($product->getListItems() as $listItems)
112 112
 		{
113
-			$this->assertEquals( 3, count( $listItems ) );
113
+			$this->assertEquals(3, count($listItems));
114 114
 
115
-			foreach( $listItems as $listItem )
115
+			foreach ($listItems as $listItem)
116 116
 			{
117
-				$this->assertEquals( 1, $listItem->getStatus() );
118
-				$this->assertEquals( 'attribute', $listItem->getDomain() );
119
-				$this->assertEquals( 'variant', $listItem->getType() );
120
-				$this->assertEquals( $codes[$pos], $listItem->getRefItem()->getCode() );
117
+				$this->assertEquals(1, $listItem->getStatus());
118
+				$this->assertEquals('attribute', $listItem->getDomain());
119
+				$this->assertEquals('variant', $listItem->getType());
120
+				$this->assertEquals($codes[$pos], $listItem->getRefItem()->getCode());
121 121
 				$pos++;
122 122
 			}
123 123
 		}
@@ -141,21 +141,21 @@  discard block
 block discarded – undo
141 141
 			1 => '29',
142 142
 		);
143 143
 
144
-		$product = $this->create( 'job_csv_test' );
144
+		$product = $this->create('job_csv_test');
145 145
 
146
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint );
147
-		$object->process( $product, $data );
148
-		$object->process( $product, $dataUpdate );
146
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint);
147
+		$object->process($product, $data);
148
+		$object->process($product, $dataUpdate);
149 149
 
150 150
 
151 151
 		$listItems = $product->getListItems();
152
-		$listItem = reset( $listItems );
152
+		$listItem = reset($listItems);
153 153
 
154
-		$this->assertEquals( 1, count( $listItems ) );
155
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
154
+		$this->assertEquals(1, count($listItems));
155
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
156 156
 
157
-		$this->assertEquals( 'width', $listItem->getRefItem()->getType() );
158
-		$this->assertEquals( '29', $listItem->getRefItem()->getCode() );
157
+		$this->assertEquals('width', $listItem->getRefItem()->getType());
158
+		$this->assertEquals('29', $listItem->getRefItem()->getCode());
159 159
 	}
160 160
 
161 161
 
@@ -171,18 +171,18 @@  discard block
 block discarded – undo
171 171
 			1 => '30',
172 172
 		);
173 173
 
174
-		$product = $this->create( 'job_csv_test' );
174
+		$product = $this->create('job_csv_test');
175 175
 
176
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint );
177
-		$object->process( $product, $data );
176
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint);
177
+		$object->process($product, $data);
178 178
 
179
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, [], $this->endpoint );
180
-		$object->process( $product, [] );
179
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, [], $this->endpoint);
180
+		$object->process($product, []);
181 181
 
182 182
 
183 183
 		$listItems = $product->getListItems();
184 184
 
185
-		$this->assertEquals( 0, count( $listItems ) );
185
+		$this->assertEquals(0, count($listItems));
186 186
 	}
187 187
 
188 188
 
@@ -202,15 +202,15 @@  discard block
 block discarded – undo
202 202
 			3 => '30',
203 203
 		);
204 204
 
205
-		$product = $this->create( 'job_csv_test' );
205
+		$product = $this->create('job_csv_test');
206 206
 
207
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint );
208
-		$object->process( $product, $data );
207
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint);
208
+		$object->process($product, $data);
209 209
 
210 210
 
211 211
 		$listItems = $product->getListItems();
212 212
 
213
-		$this->assertEquals( 1, count( $listItems ) );
213
+		$this->assertEquals(1, count($listItems));
214 214
 	}
215 215
 
216 216
 
@@ -226,17 +226,17 @@  discard block
 block discarded – undo
226 226
 			1 => '30',
227 227
 		);
228 228
 
229
-		$product = $this->create( 'job_csv_test' );
229
+		$product = $this->create('job_csv_test');
230 230
 
231
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint );
231
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint);
232 232
 
233 233
 		try {
234
-			$object->process( $product, $data );
235
-		} catch( \Exception $e ) {
234
+			$object->process($product, $data);
235
+		} catch (\Exception $e) {
236 236
 			return;
237 237
 		}
238 238
 
239
-		$this->markTestFail( 'No exception thrown' );
239
+		$this->markTestFail('No exception thrown');
240 240
 	}
241 241
 
242 242
 
@@ -260,32 +260,32 @@  discard block
 block discarded – undo
260 260
 			5 => 'default',
261 261
 		);
262 262
 
263
-		$this->context->getConfig()->set( 'controller/common/product/import/csv/processor/attribute/listtypes', array( 'default' ) );
263
+		$this->context->getConfig()->set('controller/common/product/import/csv/processor/attribute/listtypes', array('default'));
264 264
 
265
-		$product = $this->create( 'job_csv_test' );
265
+		$product = $this->create('job_csv_test');
266 266
 
267
-		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard( $this->context, $mapping, $this->endpoint );
268
-		$object->process( $product, $data );
267
+		$object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Attribute\Standard($this->context, $mapping, $this->endpoint);
268
+		$object->process($product, $data);
269 269
 
270 270
 
271 271
 		$listItems = $product->getListItems();
272
-		$listItem = reset( $listItems );
272
+		$listItem = reset($listItems);
273 273
 
274
-		$this->assertEquals( 1, count( $listItems ) );
275
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem );
274
+		$this->assertEquals(1, count($listItems));
275
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem);
276 276
 
277
-		$this->assertEquals( 'default', $listItem->getType() );
278
-		$this->assertEquals( 'width', $listItem->getRefItem()->getType() );
279
-		$this->assertEquals( '30', $listItem->getRefItem()->getCode() );
277
+		$this->assertEquals('default', $listItem->getType());
278
+		$this->assertEquals('width', $listItem->getRefItem()->getType());
279
+		$this->assertEquals('30', $listItem->getRefItem()->getCode());
280 280
 	}
281 281
 
282 282
 
283 283
 	/**
284 284
 	 * @param string $code
285 285
 	 */
286
-	protected function create( $code )
286
+	protected function create($code)
287 287
 	{
288
-		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context );
289
-		return $manager->createItem()->setCode( $code );
288
+		$manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context);
289
+		return $manager->createItem()->setCode($code);
290 290
 	}
291 291
 }
292 292
\ No newline at end of file
Please login to merge, or discard this patch.