@@ -156,6 +156,7 @@ public function testConfigurableImport($pathToFile, $productName, $optionSkuList
156
156
* @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php
157
157
* @magentoAppArea adminhtml
158
158
* @magentoAppIsolation enabled
159
+ * @return void
159
160
*/
160
161
public function testConfigurableImportWithMultipleStores ()
161
162
{
@@ -176,23 +177,21 @@ public function testConfigurableImportWithMultipleStores()
176
177
'directory ' => $ directory ,
177
178
]
178
179
);
179
- $ errors = $ this ->model ->setSource (
180
- $ source
181
- )->setParameters (
180
+ $ errors = $ this ->model ->setSource ($ source )->setParameters (
182
181
[
183
182
'behavior ' => \Magento \ImportExport \Model \Import::BEHAVIOR_APPEND ,
184
183
'entity ' => 'catalog_product ' ,
185
184
]
186
185
)->validateData ();
187
186
188
- $ this ->assertTrue ($ errors ->getErrorsCount () == 0 );
187
+ $ this ->assertTrue ($ errors ->getErrorsCount () === 0 );
189
188
$ this ->model ->importData ();
190
189
191
190
foreach ($ products as $ storeCode => $ productName ) {
192
191
$ store = $ this ->objectManager ->create (\Magento \Store \Model \Store::class);
193
192
$ store ->load ($ storeCode , 'code ' );
194
- /** @var \Magento\Catalog\Api\ ProductRepositoryInterface $productRepository */
195
- $ productRepository = $ this ->objectManager ->get (\ Magento \ Catalog \ Api \ ProductRepositoryInterface::class);
193
+ /** @var ProductRepositoryInterface $productRepository */
194
+ $ productRepository = $ this ->objectManager ->get (ProductRepositoryInterface::class);
196
195
/** @var \Magento\Catalog\Api\Data\ProductInterface $product */
197
196
$ product = $ productRepository ->get ($ productSku , 0 , $ store ->getId ());
198
197
$ this ->assertFalse ($ product ->isObjectNew ());
@@ -206,35 +205,32 @@ public function testConfigurableImportWithMultipleStores()
206
205
* @magentoDataFixture Magento/ConfigurableProduct/_files/configurable_attribute.php
207
206
* @magentoDbIsolation disabled
208
207
* @magentoAppArea adminhtml
208
+ * @return void
209
209
*/
210
210
public function testConfigurableImportWithStoreSpecifiedMainItem ()
211
211
{
212
- {
213
- $ expectedErrorMessage = 'Product with assigned super attributes should not have specified "store_view_code" '
214
- . ' value ' ;
215
- $ filesystem = $ this ->objectManager ->create (
216
- \Magento \Framework \Filesystem::class
217
- );
218
-
219
- $ directory = $ filesystem ->getDirectoryWrite (DirectoryList::ROOT );
220
- $ source = $ this ->objectManager ->create (
221
- \Magento \ImportExport \Model \Import \Source \Csv::class,
222
- [
223
- 'file ' => __DIR__ . '/../../_files/import_configurable_for_multiple_store_views_error.csv ' ,
224
- 'directory ' => $ directory ,
225
- ]
226
- );
227
- $ errors = $ this ->model ->setSource (
228
- $ source
229
- )->setParameters (
230
- [
231
- 'behavior ' => \Magento \ImportExport \Model \Import::BEHAVIOR_APPEND ,
232
- 'entity ' => 'catalog_product ' ,
233
- ]
234
- )->validateData ();
235
-
236
- $ this ->assertTrue ($ errors ->getErrorsCount () == 1 );
237
- $ this ->assertEquals ($ expectedErrorMessage , $ errors ->getAllErrors ()[0 ]->getErrorMessage ());
238
- }
212
+ $ expectedErrorMessage = 'Product with assigned super attributes should not have specified "store_view_code" '
213
+ . ' value ' ;
214
+ $ filesystem = $ this ->objectManager ->create (
215
+ \Magento \Framework \Filesystem::class
216
+ );
217
+
218
+ $ directory = $ filesystem ->getDirectoryWrite (DirectoryList::ROOT );
219
+ $ source = $ this ->objectManager ->create (
220
+ \Magento \ImportExport \Model \Import \Source \Csv::class,
221
+ [
222
+ 'file ' => __DIR__ . '/../../_files/import_configurable_for_multiple_store_views_error.csv ' ,
223
+ 'directory ' => $ directory ,
224
+ ]
225
+ );
226
+ $ errors = $ this ->model ->setSource ($ source )->setParameters (
227
+ [
228
+ 'behavior ' => \Magento \ImportExport \Model \Import::BEHAVIOR_APPEND ,
229
+ 'entity ' => 'catalog_product ' ,
230
+ ]
231
+ )->validateData ();
232
+
233
+ $ this ->assertTrue ($ errors ->getErrorsCount () === 1 );
234
+ $ this ->assertEquals ($ expectedErrorMessage , $ errors ->getAllErrors ()[0 ]->getErrorMessage ());
239
235
}
240
236
}
0 commit comments