Пример #1
0
 public function testMap()
 {
     $data = ['config' => ['system' => ['sections' => ['section_1' => ['id' => 'section_1', 'children' => ['group_1' => ['id' => 'group_1', 'children' => ['field_1' => ['id' => 'field_1'], 'group_1.1' => ['id' => 'group_1.1', 'children' => ['field_1.2' => ['id' => 'field_1.2']]]]]]]]]]];
     $expected = ['config' => ['system' => ['sections' => ['section_1' => ['id' => 'section_1', 'children' => ['group_1' => ['id' => 'group_1', 'children' => ['field_1' => ['id' => 'field_1', 'path' => 'section_1/group_1'], 'group_1.1' => ['id' => 'group_1.1', 'children' => ['field_1.2' => ['id' => 'field_1.2', 'path' => 'section_1/group_1/group_1.1']], 'path' => 'section_1/group_1']], 'path' => 'section_1']]]]]]];
     $actual = $this->_model->map($data);
     $this->assertEquals($expected, $actual);
 }
Пример #2
0
 public function testMap()
 {
     $data = array('config' => array('system' => array('sections' => array('section_1' => array('id' => 'section_1', 'children' => array('group_1' => array('id' => 'group_1', 'children' => array('field_1' => array('id' => 'field_1'), 'group_1.1' => array('id' => 'group_1.1', 'children' => array('field_1.2' => array('id' => 'field_1.2')))))))))));
     $expected = array('config' => array('system' => array('sections' => array('section_1' => array('id' => 'section_1', 'children' => array('group_1' => array('id' => 'group_1', 'children' => array('field_1' => array('id' => 'field_1', 'path' => 'section_1/group_1'), 'group_1.1' => array('id' => 'group_1.1', 'children' => array('field_1.2' => array('id' => 'field_1.2', 'path' => 'section_1/group_1/group_1.1')), 'path' => 'section_1/group_1')), 'path' => 'section_1')))))));
     $actual = $this->_model->map($data);
     $this->assertEquals($expected, $actual);
 }