protected function setUp() { $this->layoutManipulator = $this->getMock('Oro\\Component\\Layout\\LayoutManipulatorInterface'); $this->blockBuilder = $this->getMock('Oro\\Component\\Layout\\BlockBuilderInterface'); $this->blockBuilder->expects($this->any())->method('getId')->will($this->returnValue(self::ROOT_ID)); $this->blockBuilder->expects($this->any())->method('getLayoutManipulator')->will($this->returnValue($this->layoutManipulator)); $this->builder = new FormLayoutBuilder(); }
/** * {@inheritdoc} */ public function buildBlock(BlockBuilderInterface $builder, array $options) { $formAccessor = $this->getFormAccessor($builder->getContext(), $options); $this->formLayoutBuilder->build($formAccessor, $builder, $options); }
/** * {@inheritdoc} */ public function buildBlock(BlockBuilderInterface $builder, array $options) { $id = $builder->getId(); $builder->getLayoutManipulator()->add($id . '_logo', $id, 'logo'); }
/** * Add the given field to the layout. * * @param string $fieldPath * @param string $id * @param string|null $parentId */ protected function addField($fieldPath, $id, $parentId = null) { $this->layoutManipulator->add($id, $parentId ?: $this->builder->getId(), FormFieldType::NAME, ['form' => $this->options['form'], 'form_name' => $this->options['form_name'], 'field_path' => $fieldPath]); }