Example #1
0
 public function testGetDependenciesWithSeparator()
 {
     $testData = array('field_4' => array('id' => 'section_2/group_3/field_4', 'value' => 'value1,value2', 'separator' => ',', 'dependPath' => array('section_2', 'group_3', 'field_4')));
     $this->_fieldMock->expects($this->once())->method('isVisible')->will($this->returnValue(true));
     $actual = $this->_model->getDependencies($testData, 'store_code', 'prefix');
     $expected = array('section_2_group_3_prefixfield_4' => array('value1', 'value2'));
     $this->assertEquals($expected, $actual);
 }
Example #2
0
 /**
  * Retrieve field dependencies
  *
  * @param $fieldPrefix
  * @param $storeCode
  * @return array
  */
 public function getDependencies($fieldPrefix, $storeCode)
 {
     $dependencies = array();
     if (false == isset($this->_data['depends']['fields'])) {
         return $dependencies;
     }
     $dependencies = $this->_dependencyMapper->getDependencies($this->_data['depends']['fields'], $storeCode, $fieldPrefix);
     return $dependencies;
 }