Example #1
0
 public function testPopulateToUrlGenerationReturnProduct()
 {
     $rowData = [\Magento\CatalogImportExport\Model\Import\Product::COL_SKU => 'value'];
     $newSku = ['entity_id' => 'new sku value'];
     $expectedRowData = [\Magento\CatalogImportExport\Model\Import\Product::COL_SKU => 'value', 'entity_id' => $newSku['entity_id']];
     $productMock = $this->getMock('\\Magento\\Catalog\\Model\\Product', ['addData'], [], '', false);
     $productMock->expects($this->once())->method('addData')->with($expectedRowData);
     $this->catalogProductFactory->expects($this->once())->method('create')->willReturn($productMock);
     $this->skuProcessor->expects($this->once())->method('getNewSku')->willReturn($newSku);
     $result = $this->importProduct->_populateToUrlGeneration($rowData);
     $this->assertEquals($productMock, $result);
 }