public function testCreateFormWithType() { /** * If we use a type, we have that type's fields. * -> The implementation is correct. */ $form = $this->controller->createForm("test_form", "test_type"); $this->assertTrue($form->getForm()->has("test_field")); $this->assertTrue($form->getForm()->has("test_a")); $this->assertTrue($form->getForm()->has("test_b")); }
public function setUp() { parent::setUp(); $this->controller = $this->getController(); $this->controller->setContainer($this->container); }
/** * @param $name * @param string $type * @param array $data * @param array $options * @return \Thelia\Form\BaseForm * * Deactivate csrf token by default on API */ public function createForm($name, $type = "form", array $data = array(), array $options = array()) { $options = array_merge(["csrf_protection" => false], $options); return parent::createForm($name, $type, $data, $options); }