Example #1
0
 public function testGetDependenciesWithDependencies()
 {
     $fields = array('field_4' => array('id' => 'section_2/group_3/field_4', 'value' => 'someValue', 'dependPath' => array('section_2', 'group_3', 'field_4')));
     $this->_model->setData(array('depends' => array('fields' => $fields)), 0);
     $this->_depMapperMock->expects($this->once())->method('getDependencies')->with($fields, 'test_scope')->will($this->returnArgument(0));
     $this->assertEquals($fields, $this->_model->getDependencies('test_scope'));
 }
Example #2
0
 /**
  * Initialize config group fields
  *
  * @param Varien_Data_Form_Element_Fieldset $fieldset
  * @param Mage_Backend_Model_Config_Structure_Element_Group $group
  * @param Mage_Backend_Model_Config_Structure_Element_Section $section
  * @param string $fieldPrefix
  * @param string $labelPrefix
  * @return Mage_Backend_Block_System_Config_Form
  */
 public function initFields(Varien_Data_Form_Element_Fieldset $fieldset, Mage_Backend_Model_Config_Structure_Element_Group $group, Mage_Backend_Model_Config_Structure_Element_Section $section, $fieldPrefix = '', $labelPrefix = '')
 {
     if (!$this->_configDataObject) {
         $this->_initObjects();
     }
     // Extends for config data
     $extraConfigGroups = array();
     /** @var $element Mage_Backend_Model_Config_Structure_Element_Field */
     foreach ($group->getChildren() as $element) {
         if ($element instanceof Mage_Backend_Model_Config_Structure_Element_Group) {
             $this->_initGroup($element, $section, $fieldset);
         } else {
             $path = $element->getPath($fieldPrefix);
             if ($element->getSectionId() != $section->getId()) {
                 $groupPath = $element->getGroupPath();
                 if (!isset($extraConfigGroups[$groupPath])) {
                     $this->_configData = $this->_configDataObject->extendConfig($groupPath, false, $this->_configData);
                     $extraConfigGroups[$groupPath] = true;
                 }
             }
             $this->_initElement($element, $fieldset, $path, $fieldPrefix, $labelPrefix);
         }
     }
     return $this;
 }