예제 #1
0
 public function testAddFieldsWithoutExperimentCode()
 {
     $experimentCode = '';
     $experimentCodeId = '';
     $this->_prepareFormMock($experimentCode, $experimentCodeId);
     $this->_helper->addGoogleoptimizerFields($this->_formMock, null);
 }
예제 #2
0
 /**
  * @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();
 }
예제 #3
0
 /**
  * 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();
 }
예제 #4
0
 /**
  * Prepare form before rendering HTML
  *
  * @return \Magento\Backend\Block\Widget\Form
  */
 protected function _prepareForm()
 {
     $this->_formHelper->addGoogleoptimizerFields($this->getForm(), $this->_getGoogleExperiment());
     return parent::_prepareForm();
 }