/** * Modification of attribute config * * @param string $attributeCode * @param array $attributeConfig * @return array * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function modifyAttributeConfig($attributeCode, array $attributeConfig) { /** @var Product $product */ $product = $this->locator->getProduct(); /** @var EavAttribute $eavAttribute */ $eavAttribute = $this->eavAttributeFactory->create()->loadByCode(Product::ENTITY, $attributeCode); return array_replace_recursive($attributeConfig, ['arguments' => ['data' => ['config' => ['componentType' => 'dynamicRows', 'formElement' => 'component', 'renderDefaultRecord' => false, 'itemTemplate' => 'record', 'dataScope' => '', 'dndConfig' => ['enabled' => false]]]], 'children' => ['record' => ['arguments' => ['data' => ['config' => ['componentType' => Container::NAME, 'isTemplate' => true, 'is_collection' => true, 'component' => 'Magento_Ui/js/dynamic-rows/record', 'dataScope' => '']]], 'children' => ['countryState' => ['arguments' => ['data' => ['config' => ['componentType' => Container::NAME, 'component' => 'Magento_Ui/js/form/components/group', 'visible' => true, 'label' => __('Country/State')]]], 'children' => ['country' => ['arguments' => ['data' => ['config' => ['dataType' => Text::NAME, 'formElement' => Select::NAME, 'componentType' => Field::NAME, 'dataScope' => 'country', 'visible' => true, 'options' => $this->getCountries(), 'validation' => ['required-entry' => true]]]]], 'state' => ['arguments' => ['data' => ['config' => ['componentType' => Field::NAME, 'dataType' => Text::NAME, 'formElement' => Select::NAME, 'component' => 'Magento_Weee/js/regions-tax-select', 'dataScope' => 'state', 'options' => $this->getRegions(), 'filterBy' => ['field' => 'country'], 'caption' => '*', 'visible' => true]]]]]], 'value' => ['arguments' => ['data' => ['config' => ['componentType' => Field::NAME, 'formElement' => Input::NAME, 'dataType' => Price::NAME, 'label' => __('Tax'), 'enableLabel' => true, 'dataScope' => 'value', 'validation' => ['required-entry' => true]]]]], 'website_id' => ['arguments' => ['data' => ['config' => ['dataType' => Text::NAME, 'formElement' => Select::NAME, 'componentType' => Field::NAME, 'dataScope' => 'website_id', 'label' => __('Website'), 'visible' => $this->websiteManager->isMultiWebsites(), 'options' => $this->websiteManager->getWebsites($product, $eavAttribute)]]]], 'actionDelete' => ['arguments' => ['data' => ['config' => ['componentType' => 'actionDelete', 'dataType' => Text::NAME, 'label' => __('Action')]]]]]]]]); }
public function testIsMultiWebsites() { $this->storeManagerMock->expects($this->once())->method('hasSingleStore')->willReturn(true); $this->assertSame(false, $this->model->isMultiWebsites()); }