Пример #1
0
 public function testCompoundChildFormWhichMarkedAsSimpleForm()
 {
     $options = $this->getOptions();
     $form = $this->getForm();
     $formAccessor = new FormAccessor($form);
     $childForm = $this->getForm(true, 'type1', 'field1');
     $childForm->add($this->getForm(false, 'type11', 'field11'));
     $form->add($childForm);
     $form->add($this->getForm(false, 'type2', 'field2'));
     $this->layoutManipulator->expects($this->at(0))->method('add')->with(self::FIELD_PREFIX . 'field1', self::ROOT_ID, FormFieldType::NAME, ['form' => null, 'form_name' => self::FORM_NAME, 'field_path' => 'field1'])->will($this->returnSelf());
     $this->layoutManipulator->expects($this->at(1))->method('add')->with(self::FIELD_PREFIX . 'field2', self::ROOT_ID, FormFieldType::NAME, ['form' => null, 'form_name' => self::FORM_NAME, 'field_path' => 'field2'])->will($this->returnSelf());
     $this->layoutManipulator->expects($this->exactly(2))->method('add');
     $this->builder->addSimpleFormTypes(['type1']);
     $this->builder->build($formAccessor, $this->blockBuilder, $options);
     $this->assertSame(['field1' => self::FIELD_PREFIX . 'field1', 'field2' => self::FIELD_PREFIX . 'field2'], $formAccessor->getProcessedFields());
 }