當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Config::method方法代碼示例

本文整理匯總了PHP中Magento\Eav\Model\Config::method方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::method方法的具體用法?PHP Config::method怎麽用?PHP Config::method使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Eav\Model\Config的用法示例。


在下文中一共展示了Config::method方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 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([]);
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:31,代碼來源:AdvancedPricingTest.php

示例2: getFilterArray

 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']);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:6,代碼來源:ProductImageTest.php


注:本文中的Magento\Eav\Model\Config::method方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。