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


PHP UiComponent\ContextInterface類代碼示例

本文整理匯總了PHP中Magento\Framework\View\Element\UiComponent\ContextInterface的典型用法代碼示例。如果您正苦於以下問題:PHP ContextInterface類的具體用法?PHP ContextInterface怎麽用?PHP ContextInterface使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: setUp

 protected function setUp()
 {
     $this->objectManager = new ObjectManager($this);
     $this->contextMock = $this->getMockBuilder(ContextInterface::class)->getMockForAbstractClass();
     $this->processorMock = $this->getMockBuilder(Processor::class)->disableOriginalConstructor()->getMock();
     $this->contextMock->expects($this->any())->method('getProcessor')->willReturn($this->processorMock);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:7,代碼來源:AbstractElementTest.php

示例2: setUp

 /**
  * Set up
  */
 public function setUp()
 {
     $this->objectManager = new ObjectManager($this);
     $this->contextMock = $this->getMockForAbstractClass('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface', [], '', false, true, true, []);
     $processor = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->getMock();
     $this->contextMock->expects($this->any())->method('getProcessor')->willReturn($processor);
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:10,代碼來源:ColumnsTest.php

示例3: setUp

 /**
  * @return void
  */
 protected function setUp()
 {
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $processorMock = $this->getMock('Magento\\Framework\\View\\Element\\UiComponent\\Processor', [], [], '', false, false);
     $processorMock->expects($this->once())->method('register');
     $this->contextMock = $this->getMock('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface');
     $this->contextMock->expects($this->any())->method('getProcessor')->willReturn($processorMock);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:11,代碼來源:UseConfigSettingsTest.php

示例4: setup

 public function setup()
 {
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface')->getMockForAbstractClass();
     $processor = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->any())->method('getProcessor')->willReturn($processor);
     $this->uiComponentFactory = $this->getMock('Magento\\Framework\\View\\Element\\UiComponentFactory', [], [], '', false);
     $this->component = new AccountLock($this->context, $this->uiComponentFactory);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:8,代碼來源:AccountLockTest.php

示例5: __construct

 /**
  * @param ContextInterface $context
  * @param FormFactory $formFactory
  * @param ConfigInterface $wysiwygConfig
  * @param array $components
  * @param array $data
  * @param array $config
  */
 public function __construct(ContextInterface $context, FormFactory $formFactory, ConfigInterface $wysiwygConfig, array $components = [], array $data = [], array $config = [])
 {
     $wysiwygConfigData = isset($config['wysiwygConfigData']) ? $config['wysiwygConfigData'] : [];
     $this->form = $formFactory->create();
     $this->editor = $this->form->addField($context->getNamespace() . '_' . $data['name'], 'Magento\\Framework\\Data\\Form\\Element\\Editor', ['force_load' => true, 'rows' => 20, 'name' => $data['name'], 'config' => $wysiwygConfig->getConfig($wysiwygConfigData), 'wysiwyg' => isset($config['wysiwyg']) ? $config['wysiwyg'] : null]);
     $data['config']['content'] = $this->editor->getElementHtml();
     parent::__construct($context, $components, $data);
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:16,代碼來源:Wysiwyg.php

示例6: __construct

 /**
  * Constructor
  *
  * @param ContextInterface $context
  * @param UiComponentInterface[] $components
  * @param array $data
  */
 public function __construct(ContextInterface $context, array $components = [], array $data = [])
 {
     $this->context = $context;
     $this->components = $components;
     $this->initObservers($data);
     $this->context->getProcessor()->register($this);
     $this->_data = array_replace_recursive($this->_data, $data);
 }
開發者ID:hientruong90,項目名稱:magento2_installer,代碼行數:15,代碼來源:AbstractComponent.php

示例7: setUp

 /**
  * Set up
  *
  * @return void
  */
 protected function setUp()
 {
     $this->uiComponentFactoryMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponentFactory')->disableOriginalConstructor()->getMock();
     $this->contextMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface')->getMockForAbstractClass();
     $processor = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->getMock();
     $this->contextMock->expects($this->any())->method('getProcessor')->willReturn($processor);
     $this->multiline = new Multiline($this->contextMock, $this->uiComponentFactoryMock);
 }
開發者ID:tingyeeh,項目名稱:magento2,代碼行數:13,代碼來源:MultilineTest.php

示例8: setup

 public function setup()
 {
     $this->processor = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->getMock();
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface')->getMockForAbstractClass();
     $this->context->expects($this->once())->method('getProcessor')->willReturn($this->processor);
     $this->uiComponentFactory = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponentFactory')->disableOriginalConstructor()->getMock();
     $this->scopeConfig = $this->getMockBuilder('Magento\\Framework\\App\\Config\\ScopeConfigInterface')->getMockForAbstractClass();
     $this->confirmation = new Confirmation($this->context, $this->uiComponentFactory, $this->scopeConfig, [], []);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:9,代碼來源:ConfirmationTest.php

示例9: setUp

 protected function setUp()
 {
     $this->urlBuilderMock = $this->getMockBuilder(UrlInterface::class)->getMockForAbstractClass();
     $this->contextMock = $this->getMockBuilder(ContextInterface::class)->getMockForAbstractClass();
     $this->uiElementProcessorMock = $this->getMockBuilder(UiElementProcessor::class)->disableOriginalConstructor()->getMock();
     $this->contextMock->expects(static::any())->method('getProcessor')->willReturn($this->uiElementProcessorMock);
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->nameColumn = $this->objectManagerHelper->getObject(NameColumn::class, ['urlBuilder' => $this->urlBuilderMock, 'context' => $this->contextMock]);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:9,代碼來源:NameTest.php

示例10: setup

 public function setup()
 {
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface')->getMockForAbstractClass();
     $processor = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->any())->method('getProcessor')->willReturn($processor);
     $this->uiComponentFactory = $this->getMock('Magento\\Framework\\View\\Element\\UiComponentFactory', [], [], '', false);
     $this->urlBuilder = $this->getMockForAbstractClass('Magento\\Framework\\UrlInterface', [], '', false);
     $this->component = new EditAction($this->context, $this->uiComponentFactory, $this->urlBuilder, [], ['name' => 'name', 'config' => ['editUrlPath' => 'theme/design_config/edit']]);
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:9,代碼來源:EditActionTest.php

示例11: setup

 public function setup()
 {
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface')->getMockForAbstractClass();
     $processor = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->any())->method('getProcessor')->willReturn($processor);
     $this->uiComponentFactory = $this->getMock('Magento\\Framework\\View\\Element\\UiComponentFactory', [], [], '', false);
     $this->attributeRepository = $this->getMock('Magento\\Customer\\Ui\\Component\\Listing\\AttributeRepository', [], [], '', false);
     $this->attributeMetadata = $this->getMockForAbstractClass('\\Magento\\Customer\\Api\\Data\\AttributeMetadataInterface', [], '', false);
     $this->component = new AttributeColumn($this->context, $this->uiComponentFactory, $this->attributeRepository);
     $this->component->setData('name', 'gender');
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:11,代碼來源:AttributeColumnTest.php

示例12: setUp

 protected function setUp()
 {
     $this->context = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface')->getMockForAbstractClass();
     $processor = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->getMock();
     $this->context->expects($this->any())->method('getProcessor')->willReturn($processor);
     $this->columnFactory = $this->getMock('Magento\\Customer\\Ui\\Component\\ColumnFactory', ['create'], [], '', false);
     $this->attributeRepository = $this->getMock('Magento\\Customer\\Ui\\Component\\Listing\\AttributeRepository', [], [], '', false);
     $this->attribute = $this->getMock('Magento\\Customer\\Model\\Attribute', [], [], '', false);
     $this->column = $this->getMockForAbstractClass('Magento\\Ui\\Component\\Listing\\Columns\\ColumnInterface', [], '', false);
     $this->inlineEditUpdater = $this->getMockBuilder('Magento\\Customer\\Ui\\Component\\Listing\\Column\\InlineEditUpdater')->disableOriginalConstructor()->getMock();
     $this->component = new Columns($this->context, $this->columnFactory, $this->attributeRepository, $this->inlineEditUpdater);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:12,代碼來源:ColumnsTest.php

示例13: setUp

 protected function setUp()
 {
     $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
     $this->processorMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\Processor')->disableOriginalConstructor()->setMethods([])->getMock();
     $this->contextMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponent\\ContextInterface')->disableOriginalConstructor()->setMethods([])->getMock();
     $this->uiComponentFactoryMock = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponentFactory')->disableOriginalConstructor()->setMethods([])->getMock();
     $this->systemStoreMock = $this->getMockBuilder('Magento\\Store\\Model\\System\\Store')->disableOriginalConstructor()->setMethods([])->getMock();
     $this->escaperMock = $this->getMockBuilder('Magento\\Framework\\Escaper')->disableOriginalConstructor()->setMethods([])->getMock();
     $this->contextMock->expects($this->atLeastOnce())->method('getProcessor')->willReturn($this->processorMock);
     $this->processorMock->expects($this->atLeastOnce())->method('register');
     $this->model = $objectManager->getObject('Magento\\Store\\Ui\\Component\\Listing\\Column\\Store', ['context' => $this->contextMock, 'uiComponent' => $this->uiComponentFactoryMock, 'systemStore' => $this->systemStoreMock, 'escaper' => $this->escaperMock, 'components' => [], 'data' => ['name' => $this->name]]);
 }
開發者ID:koliaGI,項目名稱:magento2,代碼行數:12,代碼來源:StoreTest.php

示例14: setUp

 protected function setUp()
 {
     $this->contextMock = $this->getMockBuilder(ContextInterface::class)->getMockForAbstractClass();
     $this->attributeRepositoryMock = $this->getMockBuilder(ProductAttributeRepositoryInterface::class)->getMockForAbstractClass();
     $this->searchCriteriaBuilderMock = $this->getMockBuilder(SearchCriteriaBuilder::class)->disableOriginalConstructor()->getMock();
     $this->uiElementProcessorMock = $this->getMockBuilder(UiElementProcessor::class)->disableOriginalConstructor()->getMock();
     $this->searchCriteriaMock = $this->getMockBuilder(SearchCriteria::class)->disableOriginalConstructor()->getMock();
     $this->searchResultsMock = $this->getMockBuilder(ProductAttributeSearchResultsInterface::class)->getMockForAbstractClass();
     $this->contextMock->expects(static::any())->method('getProcessor')->willReturn($this->uiElementProcessorMock);
     $this->searchCriteriaBuilderMock->expects(static::any())->method('addFilter')->willReturnSelf();
     $this->searchCriteriaBuilderMock->expects(static::any())->method('create')->willReturn($this->searchCriteriaMock);
     $this->objectManagerHelper = new ObjectManagerHelper($this);
     $this->attributesColumn = $this->objectManagerHelper->getObject(AttributesColumn::class, ['context' => $this->contextMock, 'attributeRepository' => $this->attributeRepositoryMock, 'searchCriteriaBuilder' => $this->searchCriteriaBuilderMock]);
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:14,代碼來源:AttributesTest.php

示例15: testPrepare

 /**
  * Run test prepare method
  *
  * @param array $data
  * @param array $filterData
  * @param array|null $expectedCondition
  * @dataProvider getPrepareDataProvider
  * @return void
  */
 public function testPrepare($data, $filterData, $expectedCondition)
 {
     $name = $data['name'];
     /** @var UiComponentInterface $uiComponent */
     $uiComponent = $this->getMockForAbstractClass('Magento\\Framework\\View\\Element\\UiComponentInterface', [], '', false);
     $uiComponent->expects($this->any())->method('getContext')->willReturn($this->contextMock);
     $this->contextMock->expects($this->any())->method('getNamespace')->willReturn(Select::NAME);
     $this->contextMock->expects($this->any())->method('addComponentDefinition')->with(Select::NAME, ['extends' => Select::NAME]);
     $this->contextMock->expects($this->any())->method('getFiltersParams')->willReturn($filterData);
     /** @var DataProviderInterface $dataProvider */
     $dataProvider = $this->getMockForAbstractClass('Magento\\Framework\\View\\Element\\UiComponent\\DataProvider\\DataProviderInterface', ['addFilter'], '', false);
     $this->contextMock->expects($this->any())->method('getDataProvider')->willReturn($dataProvider);
     if ($expectedCondition !== null) {
         $filterMock = $this->getMock('Magento\\Framework\\Api\\Filter');
         $this->filterBuilderMock->expects($this->any())->method('setConditionType')->with($expectedCondition)->willReturnSelf();
         $this->filterBuilderMock->expects($this->any())->method('setField')->with($name)->willReturnSelf();
         $this->filterBuilderMock->expects($this->any())->method('setValue')->willReturnSelf();
         $this->filterBuilderMock->expects($this->any())->method('create')->willReturn($filterMock);
         $dataProvider->expects($this->any())->method('addFilter')->with($filterMock);
     }
     /** @var \Magento\Framework\Data\OptionSourceInterface $selectOptions */
     $selectOptions = $this->getMockForAbstractClass('Magento\\Framework\\Data\\OptionSourceInterface', [], '', false);
     $this->uiComponentFactory->expects($this->any())->method('create')->with($name, Select::COMPONENT, ['context' => $this->contextMock, 'options' => $selectOptions])->willReturn($uiComponent);
     $date = new Select($this->contextMock, $this->uiComponentFactory, $this->filterBuilderMock, $this->filterModifierMock, $selectOptions, [], $data);
     $date->prepare();
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:35,代碼來源:SelectTest.php


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