@@ -96,14 +96,14 @@ protected function tearDown(): void
96
96
parent ::tearDown ();
97
97
}
98
98
99
+
99
100
/**
100
101
* @return void
101
102
*/
102
- public function testHideImageWhenColumnContainsEmptyValue (): void
103
+ public function testImportProductsWithSameImages (): void
103
104
{
104
- $ productSku = 'ABC ' ;
105
105
$ this ->moveImages ('magento_image.jpg ' );
106
- $ source = $ this ->prepareFile ('catalog_import_products_with_swatch_image .csv ' );
106
+ $ source = $ this ->prepareFile ('catalog_import_products_with_same_images .csv ' );
107
107
$ this ->updateUploader ();
108
108
$ errors = $ this ->import ->setParameters ([
109
109
'behavior ' => Import::BEHAVIOR_ADD_UPDATE ,
@@ -112,11 +112,19 @@ public function testHideImageWhenColumnContainsEmptyValue(): void
112
112
->setSource ($ source )->validateData ();
113
113
$ this ->assertEmpty ($ errors ->getAllErrors ());
114
114
$ this ->import ->importData ();
115
- $ this ->createdProductsSkus [] = $ productSku ;
115
+ $ this ->createdProductsSkus = [ ' SimpleProductForTest1 ' , ' SimpleProductForTest2 ' ] ;
116
116
$ this ->checkProductsImages ('/m/a/magento_image.jpg ' , $ this ->createdProductsSkus );
117
+ }
117
118
118
- $ this ->importDataResource ->cleanBunches ();
119
- $ source = $ this ->prepareFile ('catalog_import_products_without_swatch_image.csv ' );
119
+ /**
120
+ * @return void
121
+ * @throws NoSuchEntityException
122
+ */
123
+ public function testHideImageWhenColumnContainsEmptyValue (): void
124
+ {
125
+ $ productSku = 'ABC ' ;
126
+ $ this ->moveImages ('magento_image.jpg ' );
127
+ $ source = $ this ->prepareFile ('catalog_import_products_with_swatch_image.csv ' );
120
128
$ this ->updateUploader ();
121
129
$ errors = $ this ->import ->setParameters ([
122
130
'behavior ' => Import::BEHAVIOR_ADD_UPDATE ,
@@ -125,19 +133,11 @@ public function testHideImageWhenColumnContainsEmptyValue(): void
125
133
->setSource ($ source )->validateData ();
126
134
$ this ->assertEmpty ($ errors ->getAllErrors ());
127
135
$ this ->import ->importData ();
128
- $ this ->productRepository ->cleanCache ();
129
- $ product = $ this ->productRepository ->get ($ productSku );
130
- $ images = $ product ->getMediaGalleryImages ();
131
- $ this ->assertEmpty ($ images ->getItems ());
132
- }
136
+ $ this ->createdProductsSkus [] = $ productSku ;
137
+ $ this ->checkProductsImages ('/m/a/magento_image.jpg ' , $ this ->createdProductsSkus );
133
138
134
- /**
135
- * @return void
136
- */
137
- public function testImportProductsWithSameImages (): void
138
- {
139
- $ this ->moveImages ('magento_image.jpg ' );
140
- $ source = $ this ->prepareFile ('catalog_import_products_with_same_images.csv ' );
139
+ $ this ->importDataResource ->cleanBunches ();
140
+ $ source = $ this ->prepareFile ('catalog_import_products_without_swatch_image.csv ' );
141
141
$ this ->updateUploader ();
142
142
$ errors = $ this ->import ->setParameters ([
143
143
'behavior ' => Import::BEHAVIOR_ADD_UPDATE ,
@@ -146,8 +146,10 @@ public function testImportProductsWithSameImages(): void
146
146
->setSource ($ source )->validateData ();
147
147
$ this ->assertEmpty ($ errors ->getAllErrors ());
148
148
$ this ->import ->importData ();
149
- $ this ->createdProductsSkus = ['SimpleProductForTest1 ' , 'SimpleProductForTest2 ' ];
150
- $ this ->checkProductsImages ('/m/a/magento_image.jpg ' , $ this ->createdProductsSkus );
149
+ $ this ->productRepository ->cleanCache ();
150
+ $ product = $ this ->productRepository ->get ($ productSku );
151
+ $ images = $ product ->getMediaGalleryImages ();
152
+ $ this ->assertEmpty ($ images ->getItems ());
151
153
}
152
154
153
155
/**
0 commit comments