public function setUp() { parent::setUp(); $this->jsonHelper = $this->getMock('\\Magento\\Framework\\Json\\Helper\\Data', [], [], '', false); $this->importExportData = $this->getMock('\\Magento\\ImportExport\\Helper\\Data', [], [], '', false); $this->resourceHelper = $this->getMock('\\Magento\\ImportExport\\Model\\ResourceModel\\Helper', [], [], '', false); $this->resource = $this->getMock('\\Magento\\Framework\\App\\ResourceConnection', ['getConnection'], [], '', false); $this->connection = $this->getMockForAbstractClass('\\Magento\\Framework\\DB\\Adapter\\AdapterInterface', [], '', false); $this->resource->expects($this->any())->method('getConnection')->willReturn($this->connection); $this->dataSourceModel = $this->getMock('\\Magento\\ImportExport\\Model\\ResourceModel\\Import\\Data', [], [], '', false); $this->eavConfig = $this->getMock('\\Magento\\Eav\\Model\\Config', [], [], '', false); $entityType = $this->getMock('\\Magento\\Eav\\Model\\Entity\\Type', [], [], '', false); $entityType->method('getEntityTypeId')->willReturn(''); $this->eavConfig->method('getEntityType')->willReturn($entityType); $this->resourceFactory = $this->getMock('\\Magento\\CatalogImportExport\\Model\\Import\\Proxy\\Product\\ResourceModelFactory', ['create', 'getTable'], [], '', false); $this->resourceFactory->expects($this->any())->method('create')->willReturnSelf(); $this->resourceFactory->expects($this->any())->method('getTable')->willReturnSelf(); $this->catalogData = $this->getMock('\\Magento\\Catalog\\Helper\\Data', [], [], '', false); $this->storeResolver = $this->getMock('\\Magento\\CatalogImportExport\\Model\\Import\\Product\\StoreResolver', [], [], '', false); $this->importProduct = $this->getMock('\\Magento\\CatalogImportExport\\Model\\Import\\Product', [], [], '', false); $this->productModel = $this->getMock('\\Magento\\Catalog\\Model\\Product', [], [], '', false); $this->validator = $this->getMock('\\Magento\\AdvancedPricingImportExport\\Model\\Import\\AdvancedPricing\\Validator', ['isValid', 'getMessages'], [], '', false); $this->websiteValidator = $this->getMock('\\Magento\\AdvancedPricingImportExport\\Model\\Import\\AdvancedPricing\\Validator\\Website', [], [], '', false); $this->tierPriceValidator = $this->getMock('\\Magento\\AdvancedPricingImportExport\\Model\\Import\\AdvancedPricing\\Validator\\TierPrice', [], [], '', false); $this->stringObject = $this->getMock('\\Magento\\Framework\\Stdlib\\StringUtils', [], [], '', false); $this->errorAggregator = $this->getErrorAggregatorObject(); $this->dateTime = $this->getMock('\\Magento\\Framework\\Stdlib\\DateTime\\DateTime', ['date', 'format'], [], '', false); $this->dateTime->expects($this->any())->method('date')->willReturnSelf(); $this->advancedPricing = $this->getAdvancedPricingMock(['retrieveOldSkus', 'validateRow', 'addRowError', 'saveProductPrices', 'getCustomerGroupId', 'getWebSiteId', 'deleteProductTierPrices', 'getBehavior', 'saveAndReplaceAdvancedPrices', 'processCountExistingPrices', 'processCountNewPrices']); $this->advancedPricing->expects($this->any())->method('retrieveOldSkus')->willReturn([]); }
protected function getFilterArray($expected) { $this->eavConfigMock->method('getEntityAttributeCodes')->with('catalog_product')->willReturn($expected['attribute_codes_array']); $this->eavConfigMock->method('getAttribute')->with('catalog_product', $expected['attribute_code'])->willReturn($this->attributeMock); $this->attributeMock->expects($this->exactly($expected['getId_count']))->method('getId')->willReturn($expected['getId']); }