Inheritance: extends FluidTYPO3\Flux\Form\AbstractFormContainer, implements FluidTYPO3\Flux\Form\ContainerInterface, implements FluidTYPO3\Flux\Form\FieldContainerInterface
 /**
  * @test
  */
 public function canGetContainerInstanceFromTemplateVariables()
 {
     $sheet = Form\Container\Sheet::create();
     $instance = $this->createMockedInstanceForVariableContainerTests();
     ObjectAccess::getProperty($instance, 'viewHelperVariableContainer', TRUE)->expects($this->any())->method('exists')->will($this->returnValue(FALSE));
     ObjectAccess::getProperty($instance, 'templateVariableContainer', TRUE)->expects($this->any())->method('exists')->will($this->returnValue(TRUE));
     ObjectAccess::getProperty($instance, 'templateVariableContainer', TRUE)->expects($this->any())->method('get')->will($this->returnValue($sheet));
     $output = $this->callInaccessibleMethod($instance, 'getContainer');
     $this->assertSame($sheet, $output);
 }
Ejemplo n.º 2
0
 /**
  * @param array $settings
  * @return Form
  */
 public static function create(array $settings = array())
 {
     $form = parent::create($settings);
     if (TRUE === isset($settings['sheets'])) {
         foreach ($settings['sheets'] as $sheetName => $sheetSettings) {
             if (FALSE === isset($sheetSettings['name'])) {
                 $sheetSettings['name'] = $sheetName;
             }
             $sheet = Form\Container\Sheet::create($sheetSettings);
             $form->add($sheet);
         }
     }
     return $form;
 }