Skip to content

Commit 7719b94

Browse files
author
Mohan Ahuja
committed
ACP2E-841: Advanced Pricing Import status message shows wrong count products number of updates
- Fixing integration test failures
1 parent c437bd3 commit 7719b94

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/Model/Import/AdvancedPricingTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,19 @@ public function testImportAddUpdateCounts()
465465
\Magento\AdvancedPricingImportExport\Model\Import\AdvancedPricing::class
466466
);
467467
$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);
469469
$this->assertEquals(0, $errors->getErrorsCount(), 'Advanced pricing import validation error');
470470
$this->model->importData();
471471

472472
$this->assertEquals(127, $this->model->getCreatedItemsCount(), 'Advance pricing create count1');
473473
$this->assertEquals(0, $this->model->getUpdatedItemsCount(), 'Advance pricing update count1');
474474

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);
476481
$this->assertEquals(0, $this->model->getCreatedItemsCount(), 'Advance pricing create count2');
477482
$this->assertEquals(127, $this->model->getUpdatedItemsCount(), 'Advance pricing update count2');
478483
}

0 commit comments

Comments
 (0)