/**
  * @return void
  */
 public function testPerform()
 {
     $recordsData = ['record_1' => ['field_name' => []], 'record_2' => ['field_name' => []], 'record_3' => ['field_name' => []]];
     $this->progress->expects($this->once())->method('start')->with('3');
     $this->progress->expects($this->any())->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $fields = ['field_name' => []];
     $differentFields = ['field_different' => []];
     $structure = $this->getMockBuilder('Migration\\ResourceModel\\Structure')->disableOriginalConstructor()->setMethods(['getFields'])->getMock();
     $structure->expects($this->at(0))->method('getFields')->willReturn($differentFields);
     $structure->expects($this->any())->method('getFields')->willReturn($fields);
     $document = $this->getMockBuilder('Migration\\ResourceModel\\Document')->disableOriginalConstructor()->setMethods(['getName', 'getRecords', 'getStructure'])->getMock();
     $document->expects($this->any())->method('getStructure')->willReturn($structure);
     $recordsCollection = $this->getMockBuilder('Migration\\ResourceModel\\Record\\Collection')->disableOriginalConstructor()->setMethods(['addRecord'])->getMock();
     $document->expects($this->any())->method('getRecords')->willReturn($recordsCollection);
     $record = $this->getMockBuilder('Migration\\ResourceModel\\Record')->disableOriginalConstructor()->setMethods(['getFields', 'setValue'])->getMock();
     $record->expects($this->once())->method('getFields')->willReturn(array_keys($fields));
     $record->expects($this->once())->method('setValue')->willReturnSelf();
     $this->recordFactory->expects($this->any())->method('create')->with(['document' => $document])->will($this->returnValue($record));
     $recordsCollection->expects($this->any())->method('addRecord')->with($record);
     $this->source->expects($this->any())->method('getDocument')->willReturn($document);
     $this->source->expects($this->any())->method('getRecords')->willReturnMap([['core_store', 0, null, $recordsData], ['core_store_group', 0, null, $recordsData], ['core_website', 0, null, $recordsData]]);
     $this->destination->expects($this->any())->method('getDocument')->willReturn($document);
     $this->destination->expects($this->any())->method('clearDocument')->willReturnSelf();
     $this->helper->expects($this->any())->method('getDocumentList')->willReturn(['core_store' => 'store', 'core_store_group' => 'store_group', 'core_website' => 'store_website']);
     $this->data = new Data($this->progress, $this->source, $this->destination, $this->recordFactory, $this->helper);
     $this->data->perform();
 }
 /**
  * @return void
  */
 public function setUp()
 {
     $this->config = $this->getMockBuilder('Migration\\Config')->disableOriginalConstructor()->setMethods(['getSource'])->getMock();
     $this->config->expects($this->any())->method('getSource')->will($this->returnValue(['type' => DatabaseStage::SOURCE_TYPE]));
     $this->source = $this->getMockBuilder('Migration\\ResourceModel\\Source')->disableOriginalConstructor()->setMethods(['getDocument', 'getRecordsCount', 'getAdapter', 'addDocumentPrefix', 'getRecords'])->getMock();
     $this->source->expects($this->any())->method('addDocumentPrefix')->willReturnCallback(function ($name) {
         return 'source_suffix_' . $name;
     });
     $this->destination = $this->getMockBuilder('Migration\\ResourceModel\\Destination')->disableOriginalConstructor()->setMethods(['getDocument', 'getRecordsCount', 'getAdapter', 'addDocumentPrefix', 'saveRecords'])->getMock();
     $this->destination->expects($this->any())->method('addDocumentPrefix')->willReturnCallback(function ($name) {
         return 'destination_suffix_' . $name;
     });
     $this->progress = $this->getMockBuilder('Migration\\App\\ProgressBar\\LogLevelProcessor')->disableOriginalConstructor()->setMethods(['start', 'finish', 'advance'])->getMock();
     $this->progress->expects($this->any())->method('start');
     $this->progress->expects($this->any())->method('finish');
     $this->progress->expects($this->any())->method('advance');
     $this->recordFactory = $this->getMockBuilder('Migration\\ResourceModel\\RecordFactory')->disableOriginalConstructor()->setMethods(['create'])->getMock();
     $this->logger = $this->getMockBuilder('Migration\\Logger\\Logger')->disableOriginalConstructor()->setMethods(['create'])->getMock();
     $this->map = $this->getMockBuilder('Migration\\Reader\\Map')->disableOriginalConstructor()->setMethods(['getDocumentMap', 'init', 'getDocumentList', 'getDestDocumentsToClear'])->getMock();
     /** @var \Migration\Reader\MapFactory|\PHPUnit_Framework_MockObject_MockObject $mapFactory */
     $mapFactory = $this->getMockBuilder('Migration\\Reader\\MapFactory')->disableOriginalConstructor()->setMethods(['create'])->getMock();
     $mapFactory->expects($this->any())->method('create')->with('customer_attr_map_file')->willReturn($this->map);
     $this->groups = $this->getMockBuilder('Migration\\Reader\\Groups')->disableOriginalConstructor()->getMock();
     $this->groups->expects($this->any())->method('getGroup')->with('source_documents')->willReturn(['source_document_1' => 'entity_id']);
     /** @var \Migration\Reader\GroupsFactory|\PHPUnit_Framework_MockObject_MockObject $groupsFactory */
     $groupsFactory = $this->getMockBuilder('Migration\\Reader\\GroupsFactory')->disableOriginalConstructor()->setMethods(['create'])->getMock();
     $groupsFactory->expects($this->any())->method('create')->with('customer_attr_document_groups_file')->willReturn($this->groups);
     $this->logger = $this->getMockBuilder('Migration\\Logger\\Logger')->disableOriginalConstructor()->setMethods(['debug'])->getMock();
     $this->step = new Data($this->config, $this->source, $this->destination, $this->progress, $this->recordFactory, $mapFactory, $groupsFactory, $this->logger);
 }
 public function testData()
 {
     $this->source->expects($this->once())->method('getRecordsCount')->willReturn(123);
     $this->progress->expects($this->at(0))->method('start')->with($this->equalTo(123));
     $sourceDocument = $this->getMockBuilder('\\Migration\\Resource\\Document')->disableOriginalConstructor()->getMock();
     $this->source->expects($this->once())->method('getDocument')->with($this->equalTo(\Migration\Step\UrlRewrite\Version191to2000::SOURCE))->willReturn($sourceDocument);
     $destinationDocument = $this->getMockBuilder('\\Migration\\Resource\\Document')->disableOriginalConstructor()->getMock();
     $this->destination->expects($this->at(0))->method('getDocument')->with($this->equalTo(\Migration\Step\UrlRewrite\Version191to2000::DESTINATION))->willReturn($destinationDocument);
     $destinationProductCategory = $this->getMockBuilder('\\Migration\\Resource\\Document')->setMethods(['setValue', 'getRecords'])->disableOriginalConstructor()->getMock();
     $this->destination->expects($this->at(1))->method('getDocument')->with($this->equalTo(\Migration\Step\UrlRewrite\Version191to2000::DESTINATION_PRODUCT_CATEGORY))->willReturn($destinationProductCategory);
     $this->destination->expects($this->exactly(2))->method('clearDocument')->withConsecutive([\Migration\Step\UrlRewrite\Version191to2000::DESTINATION], [\Migration\Step\UrlRewrite\Version191to2000::DESTINATION_PRODUCT_CATEGORY]);
     $this->source->expects($this->at(2))->method('getRecords')->with($this->equalTo(\Migration\Step\UrlRewrite\Version191to2000::SOURCE), $this->equalTo(0))->willReturn(['RecordData1']);
     $sourceRecord = $this->getMockBuilder('\\Migration\\Resource\\Record')->disableOriginalConstructor()->getMock();
     $this->recordFactory->expects($this->at(0))->method('create')->with($this->equalTo(['document' => $sourceDocument, 'data' => 'RecordData1']))->willReturn($sourceRecord);
     $destinationRecord = $this->getMockBuilder('\\Migration\\Resource\\Record')->disableOriginalConstructor()->getMock();
     $this->recordFactory->expects($this->at(1))->method('create')->with($this->equalTo(['document' => $destinationDocument]))->willReturn($destinationRecord);
     $destinationCategoryRecord = $this->getMockBuilder('\\Migration\\Resource\\Record')->disableOriginalConstructor()->getMock();
     $this->recordFactory->expects($this->at(2))->method('create')->with($this->equalTo(['document' => $destinationProductCategory]))->willReturn($destinationCategoryRecord);
     $this->mockSourceRecordGetters($sourceRecord);
     $this->mockDestinationRecordSetters($destinationRecord);
     $this->mockDestinationCategorySetters($destinationCategoryRecord);
     $destinationProductCategory->expects($this->once())->method('getRecords')->willReturn($this->recordCollection);
     $destinationDocument->expects($this->once())->method('getRecords')->willReturn($this->recordCollection);
     $version = new \Migration\Step\UrlRewrite\Version191to2000($this->config, $this->source, $this->destination, $this->progress, $this->recordFactory, $this->logger, 'data');
     $this->assertTrue($version->perform());
 }
 /**
  * @covers \Migration\Step\SalesOrder\Integrity::checkEavEntities
  * @covers \Migration\Step\SalesOrder\Integrity::getEavEntities
  * @covers \Migration\Step\SalesOrder\Integrity::getIterationsCount
  * @return void
  */
 public function testPerform()
 {
     $fields = ['field1' => ['DATA_TYPE' => 'int']];
     $destinationRecord = ['attribute_code' => 'eav_entity'];
     $this->helper->expects($this->any())->method('getDocumentList')->willReturn(['source_doc' => 'dest_doc']);
     $this->helper->expects($this->once())->method('getDestEavDocument')->willReturn('eav_entity_int');
     $this->helper->expects($this->once())->method('getEavAttributes')->willReturn(['eav_entity']);
     $this->progress->expects($this->once())->method('start')->with(3);
     $this->progress->expects($this->any())->method('advance');
     $structure = $this->getMockBuilder('\\Migration\\ResourceModel\\Structure')->disableOriginalConstructor()->setMethods([])->getMock();
     $structure->expects($this->any())->method('getFields')->willReturn($fields);
     $document = $this->getMockBuilder('\\Migration\\ResourceModel\\Document')->disableOriginalConstructor()->getMock();
     $document->expects($this->any())->method('getStructure')->willReturn($structure);
     $this->source->expects($this->any())->method('getDocumentList')->willReturn(['source_doc']);
     $this->destination->expects($this->once())->method('getDocumentList')->willReturn(['dest_doc']);
     $this->destination->expects($this->any())->method('getDocument')->willReturn($document);
     $this->destination->expects($this->at(3))->method('getRecords')->willReturn([0 => $destinationRecord]);
     $this->destination->expects($this->at(4))->method('getRecords')->willReturn(null);
     $this->map->expects($this->any())->method('isDocumentIgnored')->willReturn(false);
     $this->map->expects($this->at(1))->method('getDocumentMap')->willReturn('dest_doc');
     $this->map->expects($this->at(4))->method('getDocumentMap')->willReturn('source_doc');
     $this->map->expects($this->any())->method('getFieldMap')->willReturn('field1');
     $this->source->expects($this->any())->method('getDocument')->willReturn($document);
     $this->logger->expects($this->never())->method('error');
     $this->salesOrder->perform();
 }
 /**
  * @return void
  */
 public function testPerform()
 {
     $document = $this->getMockBuilder('Migration\\ResourceModel\\Document')->disableOriginalConstructor()->getMock();
     $this->progress->expects($this->once())->method('start')->with('3');
     $this->progress->expects($this->any())->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $this->source->expects($this->any())->method('getDocument', 'getRecords')->willReturn($document);
     $this->destination->expects($this->any())->method('getDocument')->willReturn($document);
     $this->helper->expects($this->any())->method('getDocumentList')->willReturn(['core_store' => 'store', 'core_store_group' => 'store_group', 'core_website' => 'store_website']);
     $this->integrity = new Integrity($this->progress, $this->source, $this->destination, $this->helper);
     $this->assertTrue($this->integrity->perform());
 }
 /**
  * @return void
  */
 public function testPerform()
 {
     $this->data = new Data($this->destination, $this->progress);
     $this->progress->expects($this->once())->method('start')->with(1);
     $this->progress->expects($this->once())->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $this->destination->expects($this->once())->method('getAdapter')->willReturn($this->adapter);
     $this->adapter->expects($this->once())->method('getSelect')->willReturn($this->select);
     $this->select->expects($this->once())->method('from')->with('rating_store', ['rating_id'])->will($this->returnSelf());
     $this->select->expects($this->once())->method('where')->with('store_id > 0')->will($this->returnSelf());
     $this->adapter->expects($this->once())->method('loadDataFromSelect')->with($this->select)->willReturn([['rating_id' => 1]]);
     $this->adapter->expects($this->once())->method('updateDocument')->with('rating', ['is_active' => 1], 'rating_id IN (1)');
     $this->data->perform();
 }
Exemple #7
0
 public function testPerformWithError()
 {
     $eavAttributes = ['eav_attribute_1' => ['attribute_id' => '1', 'attribute_code' => 'attribute_code_1', 'attribute_model' => 1, 'backend_model' => 1, 'frontend_model' => 1, 'source_model' => 1, 'frontend_input_renderer' => 1, 'data_model' => 1], 'eav_attribute_2' => ['attribute_id' => '2', 'attribute_code' => 'attribute_code_2', 'attribute_model' => 1, 'backend_model' => 1, 'frontend_model' => 1, 'source_model' => 1, 'frontend_input_renderer' => 1, 'data_model' => 1]];
     $this->progress->expects($this->once())->method('start');
     $this->progress->expects($this->once())->method('finish');
     $this->progress->expects($this->any())->method('advance');
     $this->initialData->expects($this->atLeastOnce())->method('getAttributes')->willReturnMap([['source', $eavAttributes], ['destination', $eavAttributes]]);
     $this->helper->expects($this->any())->method('getDestinationRecords')->willReturn($eavAttributes);
     $this->helper->expects($this->any())->method('getSourceRecordsCount')->willReturnMap([['eav_attribute_set', 1], ['eav_attribute_group', 1], ['copy_document_1', 2], ['copy_document_2', 2]]);
     $this->initialData->expects($this->once())->method('getAttributeSets')->willReturn(1);
     $this->initialData->expects($this->once())->method('getAttributeGroups')->willReturn(1);
     $this->helper->expects($this->any())->method('getDestinationRecordsCount')->willReturn(1);
     $this->logger->expects($this->atLeastOnce())->method('warning');
     $this->assertFalse($this->volume->perform());
 }
 /**
  * @return void
  */
 public function testPerformFailed()
 {
     $this->volume = new Volume($this->destination, $this->logger, $this->progress);
     $this->progress->expects($this->once())->method('start')->with(1);
     $this->progress->expects($this->once())->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $this->destination->expects($this->once())->method('getAdapter')->willReturn($this->adapter);
     $this->adapter->expects($this->exactly(2))->method('getSelect')->willReturn($this->select);
     $this->select->expects($this->at(0))->method('from')->with('rating_store', ['rating_id'])->will($this->returnSelf());
     $this->select->expects($this->at(1))->method('where')->with('store_id > 0')->will($this->returnSelf());
     $this->adapter->expects($this->at(1))->method('loadDataFromSelect')->with($this->select)->willReturn([['rating_id' => 1]]);
     $this->adapter->expects($this->at(3))->method('loadDataFromSelect')->with($this->select)->willReturn([['rating_id' => 2]]);
     $this->select->expects($this->at(2))->method('from')->with('rating', ['rating_id'])->will($this->returnSelf());
     $this->select->expects($this->at(3))->method('where')->with('is_active = ?', 1)->will($this->returnSelf());
     $this->logger->expects($this->once())->method('addRecord')->with(Logger::ERROR, 'Mismatch of entities in the documents: rating, rating_store');
     $this->assertFalse($this->volume->perform());
 }
 /**
  * @return void
  */
 public function testPerform()
 {
     $fields = ['field_name' => []];
     $structure = $this->getMockBuilder('Migration\\ResourceModel\\Structure')->disableOriginalConstructor()->setMethods(['getFields'])->getMock();
     $structure->expects($this->any())->method('getFields')->will($this->returnValue($fields));
     $document = $this->getMockBuilder('Migration\\ResourceModel\\Document')->disableOriginalConstructor()->setMethods(['getStructure'])->getMock();
     $this->progress->expects($this->once())->method('start')->with('3');
     $this->progress->expects($this->any())->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $document->expects($this->any())->method('getStructure')->willReturn($structure);
     $this->source->expects($this->any())->method('getDocument')->willReturn($document);
     $this->destination->expects($this->any())->method('getDocument')->willReturn($document);
     $this->source->expects($this->any())->method('getRecordsCount')->with()->willReturn(1);
     $this->destination->expects($this->any())->method('getRecordsCount')->with()->willReturn(1);
     $this->helper->expects($this->any())->method('getDocumentList')->willReturn(['core_store' => 'store', 'core_store_group' => 'store_group', 'core_website' => 'store_website']);
     $this->volume = new Volume($this->progress, $this->source, $this->destination, $this->helper, $this->logger);
     $this->assertTrue($this->volume->perform());
 }
 /**
  * @return void
  */
 public function testPerformDestinationFail()
 {
     $this->progress->expects($this->once())->method('start')->with(1);
     $this->progress->expects($this->once())->method('advance');
     $this->progress->expects($this->never())->method('finish');
     $this->source->expects($this->once())->method('getDocumentList')->willReturn(['core_config_data']);
     $this->destination->expects($this->once())->method('getDocumentList')->willReturn([]);
     $this->logger->expects($this->once())->method('error')->with('Integrity check failed due to "core_config_data" document does not exist in the destination resource');
     $this->integrity = new Integrity($this->destination, $this->source, $this->logger, $this->progress, $this->recordFactory, $this->readerSettings, $this->handlerManagerFactory);
     $this->assertFalse($this->integrity->perform());
 }
 /**
  * @return void
  */
 public function testPerform()
 {
     $count = 2;
     $sourceRecords = [['config_id' => 1, 'scope_id' => 0, 'scope' => 'default', 'path' => 'some/path1', 'value' => 'some value4'], ['config_id' => 2, 'scope_id' => 0, 'scope' => 'default', 'path' => 'some/path3', 'value' => 'some value3']];
     $destinationRecords = [['config_id' => 1, 'scope_id' => 0, 'scope' => 'default', 'path' => 'some/path1', 'value' => 'some value1'], ['config_id' => 2, 'scope_id' => 0, 'scope' => 'default', 'path' => 'some/path2', 'value' => 'some value2']];
     $destinationRecordsFinal = [['scope_id' => 0, 'scope' => 'default', 'path' => 'some/path1', 'value' => 'some value1'], ['scope_id' => 0, 'scope' => 'default', 'path' => 'some/path2', 'value' => 'some value2'], ['scope_id' => 0, 'scope' => 'default', 'path' => 'some/path3', 'value' => 'some value3']];
     $pathMapped = [['some/path1', 'some/path1'], ['some/path3', 'some/path3']];
     $handlerParams = [['some/path1', ['class' => 'Some\\Class', 'params' => []]], ['some/path3', []]];
     $document = $this->getMock('Migration\\ResourceModel\\Document', [], [], '', false);
     $destinationRecord = $this->getMock('Migration\\ResourceModel\\Record', [], [], '', false);
     $sourceRecord = $this->getMock('Migration\\ResourceModel\\Record', ['getData', 'getValue', 'setValue'], [], '', false);
     $sourceRecord->expects($this->any())->method('getValue')->with('value')->willReturn($destinationRecords[0]['value']);
     $sourceRecord->expects($this->any())->method('setValue')->with('path', $pathMapped[1][0]);
     $sourceRecord->expects($this->any())->method('getData')->willReturn($sourceRecords[1]);
     $handler = $this->getMockBuilder('\\Migration\\Handler\\HandlerInterface')->getMock();
     $handler->expects($this->any())->method('handle')->with($sourceRecord, $destinationRecord);
     $handlerManager = $this->getMock('Migration\\Handler\\Manager', ['initHandler', 'getHandler'], [], '', false);
     $handlerManager->expects($this->once())->method('initHandler')->with('value', $handlerParams[0][1], 'some/path1');
     $handlerManager->expects($this->once())->method('getHandler')->willReturn($handler);
     $this->progress->expects($this->once())->method('start')->with($count);
     $this->progress->expects($this->exactly($count))->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $this->source->expects($this->once())->method('getRecordsCount')->with('core_config_data')->willReturn($count);
     $this->source->expects($this->once())->method('getRecords')->with('core_config_data', 0, $count)->willReturn($sourceRecords);
     $this->destination->expects($this->once())->method('getRecordsCount')->with('core_config_data')->willReturn($count);
     $this->destination->expects($this->once())->method('getDocument')->with('core_config_data')->willReturn($document);
     $this->destination->expects($this->once())->method('clearDocument')->with('core_config_data');
     $this->destination->expects($this->once())->method('saveRecords')->with('core_config_data', $destinationRecordsFinal);
     $this->destination->expects($this->once())->method('getRecords')->with('core_config_data', 0, $count)->willReturn($destinationRecords);
     $this->readerSettings->expects($this->any())->method('isNodeIgnored')->willReturn(false);
     $this->readerSettings->expects($this->any())->method('getNodeMap')->willReturnMap($pathMapped);
     $this->readerSettings->expects($this->any())->method('getValueHandler')->willReturnMap($handlerParams);
     $this->recordFactory->expects($this->at(0))->method('create')->with(['document' => $document, 'data' => $sourceRecords[0]])->willReturn($sourceRecord);
     $this->recordFactory->expects($this->at(1))->method('create')->with(['document' => $document, 'data' => $destinationRecords[0]])->willReturn($destinationRecord);
     $this->recordFactory->expects($this->at(2))->method('create')->with(['document' => $document, 'data' => $sourceRecords[1]])->willReturn($sourceRecord);
     $this->recordFactory->expects($this->at(3))->method('create')->with(['document' => $document, 'data' => []])->willReturn($destinationRecord);
     $this->handlerManagerFactory->expects($this->once())->method('create')->willReturn($handlerManager);
     $this->data = new Data($this->destination, $this->source, $this->logger, $this->progress, $this->recordFactory, $this->readerSettings, $this->handlerManagerFactory);
     $this->assertTrue($this->data->perform());
 }
 /**
  * @return void
  */
 public function testPerformFieldFail()
 {
     $this->integrity = new Integrity($this->destination, $this->logger, $this->progress);
     $this->progress->expects($this->once())->method('start')->with(1);
     $this->progress->expects($this->once())->method('advance');
     $this->progress->expects($this->never())->method('finish');
     $this->destination->expects($this->once())->method('getDocumentList')->willReturn(['rating', 'rating_store']);
     $this->structure->expects($this->once())->method('getFields')->willReturn(['field' => []]);
     $this->document->expects($this->once())->method('getStructure')->willReturn($this->structure);
     $this->destination->expects($this->once())->method('getDocument')->with('rating')->willReturn($this->document);
     $this->logger->expects($this->once())->method('error')->with('"is_active" field does not exist in "rating" document of the destination resource');
     $this->assertFalse($this->integrity->perform());
 }
Exemple #13
0
 public function testVolumeCheck()
 {
     $fields = ['field_name' => []];
     $structure = $this->getMockBuilder('Migration\\Resource\\Structure')->disableOriginalConstructor()->setMethods(['getFields'])->getMock();
     $structure->expects($this->any())->method('getFields')->will($this->returnValue($fields));
     $document = $this->getMockBuilder('Migration\\Resource\\Document')->disableOriginalConstructor()->setMethods(['getStructure'])->getMock();
     $this->progress->expects($this->once())->method('start')->with('3');
     $this->progress->expects($this->any())->method('advance');
     $this->progress->expects($this->once())->method('finish');
     $document->expects($this->any())->method('getStructure')->willReturn($structure);
     $this->source->expects($this->any())->method('getDocument')->willReturn($document);
     $this->destination->expects($this->any())->method('getDocument')->willReturn($document);
     $this->source->expects($this->any())->method('getRecordsCount')->with()->willReturn(1);
     $this->destination->expects($this->any())->method('getRecordsCount')->with()->willReturn(1);
     $this->stores = new Stores($this->progress, $this->logger, $this->source, $this->destination, $this->recordTransformerFactory, $this->recordFactory, 'volume');
     $this->assertTrue($this->stores->perform());
 }
 /**
  * @return void
  */
 public function testPerformFailExistingDocumentEntities()
 {
     $sourceDocumentName = 'source_document';
     $destDocumentName = 'dest_document';
     $eavDocumentName = 'eav_entity_int';
     $eavAttributes = ['eav_attribute_1', 'eav_attribute_2'];
     $this->helper->expects($this->any())->method('getDocumentList')->willReturn([$sourceDocumentName => $destDocumentName]);
     $this->helper->expects($this->any())->method('getEavAttributes')->willReturn($eavAttributes);
     $this->helper->expects($this->any())->method('getDestEavDocument')->willReturn($eavDocumentName);
     $this->helper->expects($this->at(3))->method('getSourceAttributes')->willReturn(1);
     $this->helper->expects($this->at(4))->method('getSourceAttributes')->willReturn(0);
     $this->progress->expects($this->any())->method('start')->with(1);
     $this->progress->expects($this->once())->method('advance');
     $this->map->expects($this->any())->method('getDocumentMap')->with($sourceDocumentName)->willReturn($destDocumentName);
     $this->source->expects($this->any())->method('getRecordsCount')->with($sourceDocumentName)->willReturn(1);
     $this->destination->expects($this->any())->method('getRecordsCount')->willReturnMap([[$destDocumentName, true, [], 2], [$eavDocumentName, true, [], 1]]);
     $this->initialData->expects($this->once())->method('getDestEavAttributesCount')->with('eav_entity_int')->willReturn(0);
     $this->logger->expects($this->once())->method('addRecord')->with(Logger::WARNING, 'Mismatch of entities in the document: ' . $destDocumentName);
     $this->assertFalse($this->salesOrder->perform());
 }