Ejemplo n.º 1
0
 /**
  * Init current element
  *
  * @param array $element
  * @return void
  * @throws \LogicException
  */
 protected function _initFlyweight(array $element)
 {
     if (!isset($element[\Magento\Backend\Model\Config\Structure::TYPE_KEY])) {
         throw new \LogicException('System config structure element must contain "type" attribute');
     }
     switch ($element[\Magento\Backend\Model\Config\Structure::TYPE_KEY]) {
         case 'group':
             $this->_flyweight = $this->_groupFlyweight;
             break;
         case 'field':
         default:
             $this->_flyweight = $this->_fieldFlyweight;
     }
     parent::_initFlyweight($element);
 }
Ejemplo n.º 2
0
 /**
  * @param string $elementId
  * @param bool $result
  * @dataProvider isLastDataProvider
  */
 public function testIsLast($elementId, $result)
 {
     $elementMock = $this->getMock('Magento\\Backend\\Model\\Config\\Structure\\Element\\Field', [], [], '', false);
     $elementMock->expects($this->once())->method('getId')->will($this->returnValue($elementId));
     $this->assertEquals($result, $this->_model->isLast($elementMock));
 }
Ejemplo n.º 3
0
 /**
  * @param \Magento\Backend\Model\Config\Structure\Element\Section $element
  */
 public function __construct(\Magento\Backend\Model\Config\Structure\Element\Section $element)
 {
     parent::__construct($element);
 }