@@ -465,14 +465,19 @@ public function testImportAddUpdateCounts()
465
465
\Magento \AdvancedPricingImportExport \Model \Import \AdvancedPricing::class
466
466
);
467
467
$ pathToFile = __DIR__ . '/_files/import_advanced_pricing_for_additional_attributes_products.csv ' ;
468
- $ errors = $ this ->doImport ($ pathToFile , DirectoryList::ROOT , Import::BEHAVIOR_ADD_UPDATE , true );
468
+ $ errors = $ this ->doImport ($ pathToFile , DirectoryList::ROOT , Import::BEHAVIOR_APPEND , true );
469
469
$ this ->assertEquals (0 , $ errors ->getErrorsCount (), 'Advanced pricing import validation error ' );
470
470
$ this ->model ->importData ();
471
471
472
472
$ this ->assertEquals (127 , $ this ->model ->getCreatedItemsCount (), 'Advance pricing create count1 ' );
473
473
$ this ->assertEquals (0 , $ this ->model ->getUpdatedItemsCount (), 'Advance pricing update count1 ' );
474
474
475
- $ this ->doImport ($ pathToFile , DirectoryList::ROOT , Import::BEHAVIOR_ADD_UPDATE );
475
+ // Initializing again, since old model object holds old count
476
+ // Import advance pricing data from CSV file
477
+ $ this ->model = $ this ->objectManager ->create (
478
+ \Magento \AdvancedPricingImportExport \Model \Import \AdvancedPricing::class
479
+ );
480
+ $ this ->doImport ($ pathToFile , DirectoryList::ROOT , Import::BEHAVIOR_APPEND );
476
481
$ this ->assertEquals (0 , $ this ->model ->getCreatedItemsCount (), 'Advance pricing create count2 ' );
477
482
$ this ->assertEquals (127 , $ this ->model ->getUpdatedItemsCount (), 'Advance pricing update count2 ' );
478
483
}
0 commit comments