public function __construct(array $form_array = null, $form_object = null) { if (null !== $form_array) { if ($form_object === null) { // init parent Koch\Form\Form with name, method and action parent::__construct($form_array['form']['name'], $form_array['form']['method'], $form_array['form']['action']); } else { $form_object::__construct($form_array['form']['name'], $form_array['form']['method'], $form_array['form']['action']); } // unset the key form inside form_array // because the "form" description is no longer needed // parent \Koch\Form\Form is already informed unset($form_array['form']); $this->validateArrayAndgenerateForm($form_array); return $this; } }
public function testuseDefaultFormDecorators_disable_via_constructor() { $form = new Form(array('useDefaultFormDecorators' => true)); $decorators = $form->getDecorators(); $this->assertEqual(array(), $decorators); unset($form); }