Example #1
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());
 }