public function testAddFieldsWithoutExperimentCode() { $experimentCode = ''; $experimentCodeId = ''; $this->_prepareFormMock($experimentCode, $experimentCodeId); $this->_helper->addGoogleoptimizerFields($this->_formMock, null); }
/** * @inheritdoc */ protected function _prepareForm() { $entityClass = $this->getData('code-entity'); $formName = $this->getData('form-name'); if (!$entityClass) { throw new ConfigurationMismatchException(__('Data key is missing: %1', ['code-entity'])); } if (!$formName) { throw new ConfigurationMismatchException(__('Data key is missing: %1', ['form-name'])); } $entity = ObjectManager::getInstance()->create($entityClass); $this->formHelper->addGoogleoptimizerFields($this->getForm(), $entity->getCode(), $formName); $this->getForm()->getElement('googleoptimizer_fields')->setData(['legend' => null]); return parent::_prepareForm(); }
/** * Prepare form before rendering HTML * * @return \Magento\Backend\Block\Widget\Form */ protected function _prepareForm() { $this->_formHelper->addGoogleoptimizerFields($this->getForm(), $this->_getGoogleExperiment(), 'category_form'); $this->getForm()->getElement('googleoptimizer_fields')->setData(['legend' => null]); return parent::_prepareForm(); }
/** * Prepare form before rendering HTML * * @return \Magento\Backend\Block\Widget\Form */ protected function _prepareForm() { $this->_formHelper->addGoogleoptimizerFields($this->getForm(), $this->_getGoogleExperiment()); return parent::_prepareForm(); }