@@ -130,14 +130,25 @@ protected function _assertCustomerData(array $expectedData)
130
130
* @param array $dataBefore
131
131
* @param array $dataAfter
132
132
* @param array $errors
133
+ * @param int $updatedItemsCount
134
+ * @param int $createdItemsCount
135
+ * @param int $deletedItemsCount
133
136
*
134
137
* @magentoDataFixture Magento/Customer/_files/import_export/customers_for_address_import.php
135
138
* @magentoAppIsolation enabled
136
139
*
137
140
* @dataProvider importDataDataProvider
138
141
*/
139
- public function testImportData ($ behavior , $ sourceFile , array $ dataBefore , array $ dataAfter , array $ errors = [])
140
- {
142
+ public function testImportData (
143
+ $ behavior ,
144
+ $ sourceFile ,
145
+ array $ dataBefore ,
146
+ array $ dataAfter ,
147
+ array $ errors = [],
148
+ $ updatedItemsCount ,
149
+ $ createdItemsCount ,
150
+ $ deletedItemsCount
151
+ ) {
141
152
\Magento \TestFramework \Helper \Bootstrap::getInstance ()
142
153
->loadArea (\Magento \Framework \App \Area::AREA_FRONTEND );
143
154
// set entity adapter parameters
@@ -173,6 +184,9 @@ public function testImportData($behavior, $sourceFile, array $dataBefore, array
173
184
174
185
// import data
175
186
$ this ->_entityAdapter ->importData ();
187
+ $ this ->assertSame ($ updatedItemsCount , $ this ->_entityAdapter ->getUpdatedItemsCount ());
188
+ $ this ->assertSame ($ createdItemsCount , $ this ->_entityAdapter ->getCreatedItemsCount ());
189
+ $ this ->assertSame ($ deletedItemsCount , $ this ->_entityAdapter ->getDeletedItemsCount ());
176
190
177
191
// assert data after import
178
192
$ this ->_assertCustomerData ($ dataAfter );
@@ -192,6 +206,10 @@ public function importDataDataProvider()
192
206
'$sourceFile ' => $ filesDirectory . self ::DELETE_FILE_NAME ,
193
207
'$dataBefore ' => $ this ->_beforeImport ,
194
208
'$dataAfter ' => [],
209
+ '$errors ' => [],
210
+ '$updatedItemsCount ' => 0 ,
211
+ '$createdItemsCount ' => 0 ,
212
+ '$deletedItemsCount ' => 1 ,
195
213
],
196
214
];
197
215
@@ -201,6 +219,9 @@ public function importDataDataProvider()
201
219
'$dataBefore ' => $ this ->_beforeImport ,
202
220
'$dataAfter ' => $ this ->_afterImport ,
203
221
'$errors ' => [],
222
+ '$updatedItemsCount ' => 1 ,
223
+ '$createdItemsCount ' => 3 ,
224
+ '$deletedItemsCount ' => 0 ,
204
225
];
205
226
206
227
return $ sourceData ;
0 commit comments